1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# this fixes polymorphic assignment relationships so the _type field is set when you assign an object to the association. #:nodoc: (record) record && @owner[@reflection[:foreign_type]] = record end alias_method_chain :replace, :assignment_anyways end end end |
Pastie