From 4e836e4de90d064fa751937a62bd03a17eafa70b Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 4 Dec 2011 01:05:29 -0200 Subject: Refactor readonly attributes conditional --- activerecord/lib/active_record/base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord') 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 -- cgit v1.2.3