Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix Namind#model_name.

  • Loading branch information...
commit 9c57bd8578e5ed47f143a2755b03ffd2ef85c65d 1 parent dc09cc0
@thedarkone thedarkone authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 activemodel/lib/active_model/naming.rb
View
6 activemodel/lib/active_model/naming.rb
@@ -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:
Please sign in to comment.
Something went wrong with that request. Please try again.