1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Remove private verify readonly attr method"

This reverts commit 7a8aee08b6.
This commit is contained in:
Rafael Mendonça França 2012-08-25 22:55:03 -03:00
parent 50bdb924ba
commit e5195be2d9

View file

@ -232,7 +232,7 @@ module ActiveRecord
raise ActiveRecordError, "can not update on a new record object" unless persisted?
attributes.each_key do |key|
raise ActiveRecordError, "#{key} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s)
raise ActiveRecordError, "#{key.to_s} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s)
end
attributes.each do |k,v|
@ -405,5 +405,9 @@ module ActiveRecord
@new_record = false
id
end
def verify_readonly_attribute(name)
raise ActiveRecordError, "#{name} is marked as readonly" if self.class.readonly_attributes.include?(name)
end
end
end