diff options
author | Will Bryant <will.bryant@gmail.com> | 2017-05-09 22:04:22 +1200 |
---|---|---|
committer | Will Bryant <will.bryant@gmail.com> | 2017-05-10 11:23:33 +1200 |
commit | ba2190b3b6e506d7e5cede710594b22f9d937f39 (patch) | |
tree | 6cb03039d9a5bea65099248e9a49040cf6fc797a /activerecord/lib | |
parent | 943efa30f5475f51fe90df5f85703d191dbd7d6e (diff) | |
download | rails-ba2190b3b6e506d7e5cede710594b22f9d937f39.tar.gz rails-ba2190b3b6e506d7e5cede710594b22f9d937f39.tar.bz2 rails-ba2190b3b6e506d7e5cede710594b22f9d937f39.zip |
fix the dirty tracking code's save hook overwriting missing attributes with initialized-to-nil attributes. fixes #29017.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute.rb b/activerecord/lib/active_record/attribute.rb index 38281158d8..5b4e967e94 100644 --- a/activerecord/lib/active_record/attribute.rb +++ b/activerecord/lib/active_record/attribute.rb @@ -231,6 +231,10 @@ module ActiveRecord false end + def forgetting_assignment + dup + end + def with_type(type) self.class.new(name, type) end |