提交 9c57bd85 编写于 作者: T thedarkone

Fix Namind#model_name.

上级 dc09cc05
......@@ -73,8 +73,10 @@ module Naming
# Returns an ActiveModel::Name object for module. It can be
# used to retrieve all kinds of naming-related information.
def model_name
namespace = self.parents.detect { |n| n.respond_to?(:_railtie) }
@_model_name ||= ActiveModel::Name.new(self, namespace)
@_model_name ||= begin
namespace = self.parents.detect { |n| n.respond_to?(:_railtie) }
ActiveModel::Name.new(self, namespace)
end
end
# Returns the plural class name of a record or class. Examples:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册