From 7a8aee08b610f6edbfe5be076dc14e5cdcf1355e Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 19 Aug 2012 17:21:07 -0300 Subject: 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. --- activerecord/lib/active_record/persistence.rb | 6 +----- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3