Permalink
Browse files

Refactor readonly attributes conditional

  • Loading branch information...
1 parent 5dfdc69 commit 4e836e4de90d064fa751937a62bd03a17eafa70b @carlosantoniodasilva carlosantoniodasilva committed Dec 4, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/lib/active_record/base.rb
@@ -2028,7 +2028,7 @@ def arel_attributes_values(include_primary_key = true, include_readonly_attribut
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 @@ def arel_attributes_values(include_primary_key = true, include_readonly_attribut
end
end
end
+
attrs
end

0 comments on commit 4e836e4

Please sign in to comment.