diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2011-12-04 01:05:29 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2011-12-04 09:21:34 -0200 |
commit | 4e836e4de90d064fa751937a62bd03a17eafa70b (patch) | |
tree | a3365d94686cdc2db4fa9eb363201e7a1064ca62 | |
parent | 5dfdc69ef91bf946ec55184053bdd7a167f7b9f1 (diff) | |
download | rails-4e836e4de90d064fa751937a62bd03a17eafa70b.tar.gz rails-4e836e4de90d064fa751937a62bd03a17eafa70b.tar.bz2 rails-4e836e4de90d064fa751937a62bd03a17eafa70b.zip |
Refactor readonly attributes conditional
-rw-r--r-- | activerecord/lib/active_record/base.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 3d55729318..9bc0023539 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2028,7 +2028,7 @@ MSG attribute_names.each do |name| if (column = column_for_attribute(name)) && (include_primary_key || !column.primary) - if include_readonly_attributes || (!include_readonly_attributes && !self.class.readonly_attributes.include?(name)) + if include_readonly_attributes || !self.class.readonly_attributes.include?(name) value = if klass.serialized_attributes.include?(name) @attributes[name].serialized_value @@ -2043,6 +2043,7 @@ MSG end end end + attrs end |