aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2013-04-03 09:56:43 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2013-04-03 09:56:43 -0700
commit9035cfc0dfc2a34b27df926afd6dd1b7862c1076 (patch)
tree0837534502212349cef63fb46a4329e519885002 /activerecord/CHANGELOG.md
parentdb924e1257f37dff441fee7c6e2bbd8ba382d7a6 (diff)
parent8fccbc1ad4fff215c63d17b9321fc69ad17e89dc (diff)
downloadrails-9035cfc0dfc2a34b27df926afd6dd1b7862c1076.tar.gz
rails-9035cfc0dfc2a34b27df926afd6dd1b7862c1076.tar.bz2
rails-9035cfc0dfc2a34b27df926afd6dd1b7862c1076.zip
Merge pull request #9141 from adamgamble/issue-9091
belongs_to :touch should touch old record when transitioning.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index c6ce77a9cc..438064a403 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -598,6 +598,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])