aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-08-19 17:21:07 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-08-19 17:24:12 -0300
commit7a8aee08b610f6edbfe5be076dc14e5cdcf1355e (patch)
treee10d4ee1fce2a6f6c2058d0d58110f8a823ac77a /activerecord
parent30f091b35a7617847bdef0c8957ce411c616c0da (diff)
downloadrails-7a8aee08b610f6edbfe5be076dc14e5cdcf1355e.tar.gz
rails-7a8aee08b610f6edbfe5be076dc14e5cdcf1355e.tar.bz2
rails-7a8aee08b610f6edbfe5be076dc14e5cdcf1355e.zip
Remove private verify readonly attr method
This method was added to be shared between update_attribute and update_column in 50725cec397d4fa0ecf1dda4e6ae845a993f1ba7, but since update_attribute was removed, and update_column has changed to delegate to update_columns, the method is not used anywhere anymore. Also remove "key.to_s" conversion when raising readonly error, since the key is being interpolated.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/persistence.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 593fed5a85..6b4b9bd103 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -218,7 +218,7 @@ module ActiveRecord
raise ActiveRecordError, "can not update on a new record object" unless persisted?
attributes.each_key do |key|
- raise ActiveRecordError, "#{key.to_s} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s)
+ raise ActiveRecordError, "#{key} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s)
end
attributes.each do |k,v|
@@ -391,9 +391,5 @@ 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