Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3850 from carlosantoniodasilva/readonly-attributes

Refactor readonly attributes conditional
  • Loading branch information...
commit 91a3e92cc20b65d371dc885077ce6203cfb0c27e 2 parents 5dfdc69 + 4e836e4
José Valim josevalim authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  activerecord/lib/active_record/base.rb
3  activerecord/lib/active_record/base.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.