From 5f6370a81bd013b801f3e4842ffd466d756d127d Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Thu, 2 Oct 2014 10:02:30 +0200 Subject: Always reset changed attributes in becomes When ```becomes``` changes @attributes it should also change @changed_attributes. Otherwise we'll experience a kind of split head situation where attributes are coming from ```self```, but changed_attributes is coming from ```klass.new```. This affects the inheritance_colmn as it's changed by new for example. Fixes #16881 --- activerecord/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 0105dfa78c..3bfaa59f06 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,9 @@ +* Fixed ActiveRecord::Relation#becomes! and changed_attributes issues for type column + + Fixes #17139. + + *Miklos Fazekas* + * Fixed several edge cases which could result in a counter cache updating twice or not updating at all for `has_many` and `has_many :through`. -- cgit v1.2.3