Permalink
Browse files

avoiding iterations and calling of underscore on all elements of array

  • Loading branch information...
1 parent 4c76040 commit 7865805636c79342155254b395147162544f88e3 @akshay-vishnoi akshay-vishnoi committed Nov 16, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/generators/named_base.rb
View
2 railties/lib/rails/generators/named_base.rb
@@ -90,7 +90,7 @@ def namespaced_class_path
end
def namespaced_path
- @namespaced_path ||= namespace.name.split("::").map {|m| m.underscore }[0]
+ @namespaced_path ||= namespace.name.split("::").first.underscore
end
def class_name

0 comments on commit 7865805

Please sign in to comment.