diff options
author | Tim Harper <timcharper@gmail.com> | 2008-05-13 19:17:40 -0600 |
---|---|---|
committer | rick <technoweenie@gmail.com> | 2008-05-31 13:23:00 -0700 |
commit | aef47dcf937a5c9f150c50b73cffd9fa9eb64915 (patch) | |
tree | 8bb596cb3279cf0b703edd6e8a3a70a7b443a082 /activesupport/lib | |
parent | f7015336f66d284cff8ecb89df9f430791ac57ea (diff) | |
download | rails-aef47dcf937a5c9f150c50b73cffd9fa9eb64915.tar.gz rails-aef47dcf937a5c9f150c50b73cffd9fa9eb64915.tar.bz2 rails-aef47dcf937a5c9f150c50b73cffd9fa9eb64915.zip |
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.
Diffstat (limited to 'activesupport/lib')
0 files changed, 0 insertions, 0 deletions