title: undefined method `exists?' for ActiveRecord::Associations::Builder:Module
body: <p><p>I have Builder and User model with email field, I want to make email as unique in both model. Below validation method is working fine when i put in Builder model but not in User model.</p></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  devise :database_authenticatable, :registerable,:recoverable, :rememberable, :trackable, :validatable, :confirmable
  attr_accessible :email, :password, :password_confirmation, :remember_me,:confirmation_token, :confirmed_at, :confirmation_sent_at, :unconfirmed_email, :provider,:uid, :name, :oauth_token, :oauth_expires_at
  validate :check_email_exists
  
  def check_email_exists
  if Builder.exists?(:email =&gt; self.email)
    errors.add(:email,"User already exists with this email, try another email")
  end
  end 
  </code></pre>
  
  <p>Error is:</p>
  
  <pre><code>NoMethodError in Devise::RegistrationsController#create 
  
  app/models/user.rb:30:in `check_email_exists'
  
  {"utf8"=&gt;"✓",
  "authenticity_token"=&gt;"EiFhJta51puZ7HZA3YzhopsKL2aJWllkl8geo3cL3gc=",
  "user"=&gt;{"email"=&gt;"builder@gmail.com",
  "password"=&gt;"[FILTERED]",
  "password_confirmation"=&gt;"[FILTERED]"},
  "commit"=&gt;"Sign up"}
  </code></pre>
  
  <p>What is the reason of error? I am trying to resolve it from lot of days but unsuccess.</p>
  
  <p>This is my builder model</p>
  
  <pre><code>class Builder &lt; ActiveRecord::Base
  devise :database_authenticatable, :registerable,
  attr_accessible :email, :password, :password_confirmation, :remember_me,
  
  validate :email_exists
  
  def email_exists
  if User.exists?(:email =&gt; self.email)
    errors.add(:email,"User already exists with this email, try another email")
  end
  end 
  </code></pre>
  
  <p>let abc@gmail.com is already there in User, Builder sign up form will tell user already exists try another email if I sign up with abc@gmail.com in Builder sign up form, that means email_exists is working fine in builder model but why throws error if i check in User model, although code is right.</p>
  
  <pre><code>class User &lt; ActiveRecord::Builder
  </code></pre>
  
  <p>Error occurs:
      Exiting
      /home/rails/Desktop/realestate/app/models/user.rb:1:in <code>&lt;top (required)&gt;': uninitialized    constant ActiveRecord::Builder (NameError)
      from /home/rails/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in</code>block in constantize'</p>