diff options
author | Adam Gamble <adamgamble@gmail.com> | 2013-01-31 21:54:41 -0600 |
---|---|---|
committer | Adam Gamble <adamgamble@gmail.com> | 2013-03-14 12:46:50 -0500 |
commit | 8fccbc1ad4fff215c63d17b9321fc69ad17e89dc (patch) | |
tree | dddbd457a233d509f912d0850ca9d6162e8624e4 /activerecord/CHANGELOG.md | |
parent | 7fc339059cbace0af8f8dbfb5c68db3f5dffd5a3 (diff) | |
download | rails-8fccbc1ad4fff215c63d17b9321fc69ad17e89dc.tar.gz rails-8fccbc1ad4fff215c63d17b9321fc69ad17e89dc.tar.bz2 rails-8fccbc1ad4fff215c63d17b9321fc69ad17e89dc.zip |
Modifies belong_to touch callback to touch old associations also #9091
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index f73fc9d9a3..7dbfad4473 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -447,6 +447,28 @@ *Aaron Stone + Rafael Mendonça França* * `Relation#merge` now only overwrites where values on the LHS of the +======= +* Belongs_to :touch behavior now touches old association when + transitioning to new association + + class Passenger < ActiveRecord::Base + belongs_to :car, touch: true + end + + car_1 = Car.create + car_2 = Car.create + + passenger = Passenger.create :car => car_1 + + passenger.car = car_2 + passenger.save + + Previously only car_2 would be touched. Now both car_1 and car_2 + will be touched. + + *Adam Gamble* + +* Relation#merge now only overwrites where values on the LHS of the merge. Consider: left = Person.where(age: [13, 14, 15]) |