Since it looks like you have a favorite_pet_id file in the faces table (as it should be), you need to use the membership association, not the has_one association, for example:
class Person < ActiveRecord::Base
has_many :pets
belongs_to :favorite_pet, :class_name => 'Pet'
end
class Pet < ActiveRecord::Base
belongs_to :person
end
This should fix your problem. Hope this helps!
source
share