rails/rails — Issue #5067: Can't use an instance of an Object in a Hash condition
Author: indspenceable
Created: 2012-02-16 21:17:34+00:00
State: open

class A < ActiveRecord::Base
belongs_to :b
end

class B < ActiveRecord::Base
has_many :a
end

A.where(:b => B.first) # raises no column exception for column "b" in tables "as"
A.where(:b_id => B.first.id) # Works

Both of these queries should do the same thing, assuming you have column "b" in table "as"