Revert "Remove private verify readonly attr method"

This reverts commit 7a8aee08.
上级 50bdb924
......@@ -232,7 +232,7 @@ def update_columns(attributes)
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 @@ def create
@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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册