Displaying 1 result from an estimated 1 matches for "set_belongs_to_associati".
2006 Jul 31
3
Polymorphic associations and single table inheritance
...has_many :addresses, :as => :addressable, :dependent => :destroy
end
class Member < Person
end
Adding an Address to a Member results in the addressable_type column
equaling "Person" when it should be "Member". Looking in
ActiveRecord::Associations::AssociationProxy#set_belongs_to_association_for
and ActiveRecord::Associations:: HasManyAssociation#construct_sql it''s
clear why.
>From
ActiveRecord::Associations::AssociationProxy#set_belongs_to_association_for:
record["#{@reflection.options[:as]}_type"] =
@owner.class.base_class.name.to_s
Removing the call to...