diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-25 22:55:03 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-25 23:02:30 -0300 |
commit | e5195be2d9efaee18e9204d00cdcd0a92ee407ac (patch) | |
tree | a77181a44815a7ac8c68ff152e5c9f871fd50f85 /activerecord | |
parent | 50bdb924ba26999a468ec4844917cefec39ba08c (diff) | |
download | rails-e5195be2d9efaee18e9204d00cdcd0a92ee407ac.tar.gz rails-e5195be2d9efaee18e9204d00cdcd0a92ee407ac.tar.bz2 rails-e5195be2d9efaee18e9204d00cdcd0a92ee407ac.zip |
Revert "Remove private verify readonly attr method"
This reverts commit 7a8aee08b610f6edbfe5be076dc14e5cdcf1355e.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index c64e3e6ccf..9c0a292a09 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -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 |