1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Call public methods rather than class_eval'ing

This commit is contained in:
Carlos Antonio da Silva 2014-08-01 19:43:59 -03:00
parent 3300fdedc7
commit 28f6b895c6

View file

@ -215,10 +215,8 @@ module ActiveModel
# provided method below, or rolling your own is required.
module Naming
def self.extended(base) #:nodoc:
base.class_eval do
remove_possible_method(:model_name)
delegate :model_name, to: :class
end
base.remove_possible_method :model_name
base.delegate :model_name, to: :class
end
# Returns an ActiveModel::Name object for module. It can be