aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-02-11 14:19:23 -0500
committerGitHub <noreply@github.com>2019-02-11 14:19:23 -0500
commit05232f3f8026103d0387ead54e537b5027ee7389 (patch)
tree39239da145a4dcbc32ce15fdde22f088ea48f97b /railties/lib
parent1bbf08bb497a022f94c7309e0525071b1a65e272 (diff)
parent3bd036637af955fb227a40790232f7915722a0de (diff)
downloadrails-05232f3f8026103d0387ead54e537b5027ee7389.tar.gz
rails-05232f3f8026103d0387ead54e537b5027ee7389.tar.bz2
rails-05232f3f8026103d0387ead54e537b5027ee7389.zip
Merge pull request #35221 from alkesh26/railities-namespaces-to-paths-optimization
Optimized namespaces_to_paths method.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/command/behavior.rb5
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