提交 28f6b895 编写于 作者: C Carlos Antonio da Silva

Call public methods rather than class_eval'ing

上级 3300fded
......@@ -215,10 +215,8 @@ def _singularize(string, replacement='_')
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册