diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-26 14:50:18 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-26 14:50:18 -0300 |
commit | f437f1104687e5bb26bf5ce791aee7d9cc0ec62a (patch) | |
tree | cc422be64e95027514920850809a0d1ef788d30e /activerecord/lib/active_record/core.rb | |
parent | 8b0753b4f0d0f66b73aac4cd26d6b575edc99fb6 (diff) | |
parent | 3bc314e65830dabd7b1c47ad1fa27be5ace0699f (diff) | |
download | rails-f437f1104687e5bb26bf5ce791aee7d9cc0ec62a.tar.gz rails-f437f1104687e5bb26bf5ce791aee7d9cc0ec62a.tar.bz2 rails-f437f1104687e5bb26bf5ce791aee7d9cc0ec62a.zip |
Merge pull request #15924 from sgrif/sg-write-unknown-column
Move writing unknown column exception to null attribute
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index c434b0d40a..3321e268d5 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -521,7 +521,7 @@ module ActiveRecord def init_internals pk = self.class.primary_key - unless @attributes.include?(pk) + if pk && !@attributes.include?(pk) @attributes.write_from_database(pk, nil) end |