title: Couldn't find with 'id' (ActiveRecord::RecordNotFound )
body: <p>I have created db connection and define models in .rb file and trying to find records, query with <code>find</code> only is working fine but query with <code>find</code>, <code>conditions</code> not working.</p>
  
  <p>my .rb file:</p>
  
  <pre><code>require 'mysql2'
  require "active_record"
  
  ActiveRecord::Base.establish_connection(
  :adapter=&gt; 'mysql2',
  :database=&gt; 'qa_1705',
  :username=&gt; 'root',
  :password=&gt;''
  )
  
  class Company &lt; ActiveRecord::Base
    has_many :item_schema_attributes, :dependent =&gt; :destroy
    has_many :schema_attributes, :dependent =&gt; :destroy   
  end
  
  class SchemaAttribute &lt; ActiveRecord::Base  
    belongs_to :company
    has_many :item_schema_attributes, :dependent =&gt; :destroy
  end
  
  class ItemSchemaAttribute &lt; ActiveRecord::Base  
    belongs_to :company
    belongs_to :schema_attribute
    belongs_to :line_item  
  end
  
  #Works fine :
  p Company.find(24)
  #&lt;Company id: 24, name: "ABC.pvt.ltd", address: "xyz"&gt;
  
  #Not working, throws error:
  
  p ItemSchemaAttribute.find(:first,:conditions =&gt; [ "schema_attribute_id = ?", 22])
  
  Couldn't find all ItemSchemaAttributes with 'id': (first, {:conditions=&gt;["schema_attribute_id = ?", 22]}) (found 0 results, but was looking for 2) (ActiveRecord::RecordNotFound)
  </code></pre>
  
  <p>full error:</p>
  
  <pre><code>/home/ac/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-4.2.1/lib/active_record/relation/finder_methods.rb:336:in `raise_record_not_found_exception!': Couldn't find all ItemSchemaAttributes with 'id': (first, {:conditions=&gt;["schema_attribute_id = ?", 22]}) (found 0 results, but was looking for 2) (ActiveRecord::RecordNotFound)
      from /home/ac/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-4.2.1/lib/active_record/relation/finder_methods.rb:479:in `find_some'
      from /home/ac/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-4.2.1/lib/active_record/relation/finder_methods.rb:438:in `find_with_ids'
      from /home/ac/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-4.2.1/lib/active_record/relation/finder_methods.rb:71:in `find'
      from /home/ac/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-4.2.1/lib/active_record/querying.rb:3:in `find'
      from /home/ac/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-4.2.1/lib/active_record/core.rb:128:in `find'
      from connect_db_active_record2.rb:33:in `&lt;main&gt;'
  </code></pre>
  
  <p>i have created rails app with same structure and it is working fine in rails console also i found that generated error converted <code>ItemSchemaAttributes</code> from <code>ItemSchemaAttribute</code> </p>