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:
parent
50bdb924ba
commit
e5195be2d9
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue