diff options
author | alkesh26 <alkesh26@gmail.com> | 2019-02-11 23:25:11 +0530 |
---|---|---|
committer | alkesh26 <alkesh26@gmail.com> | 2019-02-11 23:25:11 +0530 |
commit | 3bd036637af955fb227a40790232f7915722a0de (patch) | |
tree | 39239da145a4dcbc32ce15fdde22f088ea48f97b /railties | |
parent | 1bbf08bb497a022f94c7309e0525071b1a65e272 (diff) | |
download | rails-3bd036637af955fb227a40790232f7915722a0de.tar.gz rails-3bd036637af955fb227a40790232f7915722a0de.tar.bz2 rails-3bd036637af955fb227a40790232f7915722a0de.zip |
Optimized namespaces_to_paths method.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/command/behavior.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/command/behavior.rb b/railties/lib/rails/command/behavior.rb index 7f32b04cf1..7fb2a99e67 100644 --- a/railties/lib/rails/command/behavior.rb +++ b/railties/lib/rails/command/behavior.rb @@ -71,8 +71,9 @@ module Rails paths = [] namespaces.each do |namespace| pieces = namespace.split(":") - paths << pieces.dup.push(pieces.last).join("/") - paths << pieces.join("/") + path = pieces.join("/") + paths << "#{path}/#{pieces.last}" + paths << path end paths.uniq! paths |