Skip to content

Commit

Permalink
Use verify_readonly_attribute in the update_columns method
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Aug 26, 2012
1 parent e5195be commit cffaca4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/persistence.rb
Expand Up @@ -232,7 +232,7 @@ def update_columns(attributes)
raise ActiveRecordError, "can not update on a new record object" unless persisted? raise ActiveRecordError, "can not update on a new record object" unless persisted?


attributes.each_key do |key| attributes.each_key do |key|
raise ActiveRecordError, "#{key.to_s} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s) verify_readonly_attribute(key.to_s)
end end


attributes.each do |k,v| attributes.each do |k,v|
Expand Down

0 comments on commit cffaca4

Please sign in to comment.