Files
rails/activerecord/lib/active_record
Tim Harper 0580b31b36 belongs_to polymorphic association assignments update the foreign_id and foreign_type fields regardless of whether the record being assigned is new or not.
fixes the following scenarios:
* I have validates_inclusion_of on the type field for a polymorphic belongs_to association.  I assign a new record to the model's polymorphic relationship of the proper type.  validation fails because the type field has not been updated.

* I replace the value for a ppolymorphic association to a new record of another class.  The type field still says its the previous class, and the id field points to the previous record as well.

[#191 state:closed]
2008-05-31 13:27:25 -07:00
..
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-30 04:16:57 -07:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-09 10:40:50 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-25 12:29:00 +01:00
2008-05-11 18:29:44 -05:00