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. # provided method below, or rolling your own is required.
module Naming module Naming
def self.extended(base) #:nodoc: def self.extended(base) #:nodoc:
base.class_eval do base.remove_possible_method :model_name
remove_possible_method(:model_name) base.delegate :model_name, to: :class
delegate :model_name, to: :class
end
end end
# Returns an ActiveModel::Name object for module. It can be # Returns an ActiveModel::Name object for module. It can be