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:
parent
3300fdedc7
commit
28f6b895c6
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue