aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-12-05 07:08:51 -0800
committerYves Senn <yves.senn@gmail.com>2013-12-05 07:08:51 -0800
commit23d555a0abcbe5bb143928d33aaf66b38f63338b (patch)
tree9701a5c8a35828fd619a3af91042e2cde432f6f4 /activerecord/CHANGELOG.md
parentf0c58621f104492aa1c2b6cb13ecb2d6c60541fa (diff)
parentf1a646fa74290db32fb52bb373791891ab73d693 (diff)
downloadrails-23d555a0abcbe5bb143928d33aaf66b38f63338b.tar.gz
rails-23d555a0abcbe5bb143928d33aaf66b38f63338b.tar.bz2
rails-23d555a0abcbe5bb143928d33aaf66b38f63338b.zip
Merge pull request #12646 from severin/polymorphic_belongs_to_touch
polymorphic belongs_to association with touch: true updates old record correctly
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 951ec17a85..ed076c04bb 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,17 @@
+* Polymorphic belongs_to associations with the `touch: true` option set update the timestamps of
+ the old and new owner correctly when moved between owners of different types.
+
+ Example:
+
+ class Rating < ActiveRecord::Base
+ belongs_to :rateable, polymorphic: true, touch: true
+ end
+
+ rating = Rating.create rateable: Song.find(1)
+ rating.update_attributes rateable: Book.find(2) # => timestamps of Song(1) and Book(2) are updated
+
+ *Severin Schoepke*
+
* Improve formatting of migration exception messages: make them easier to read
with line breaks before/after, and improve the error for pending migrations.