Permalink
Browse files

Fix Namind#model_name.

  • Loading branch information...
1 parent dc09cc0 commit 9c57bd8578e5ed47f143a2755b03ffd2ef85c65d @thedarkone thedarkone committed Sep 26, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 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:

0 comments on commit 9c57bd8

Please sign in to comment.