Commits

Carlos Antonio committed 7a8aee0

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.

  • Participants
  • Parent commits 30f091b

Comments (0)

Files changed (1)

File activerecord/lib/active_record/persistence.rb

       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|
       @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