Permalink
Browse files

Revert "Remove private verify readonly attr method"

This reverts commit 7a8aee0.
  • Loading branch information...
1 parent 50bdb92 commit e5195be2d9efaee18e9204d00cdcd0a92ee407ac @rafaelfranca rafaelfranca committed Aug 26, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/persistence.rb
@@ -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

0 comments on commit e5195be

Please sign in to comment.