aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-06-11 17:00:49 -0400
committerGitHub <noreply@github.com>2018-06-11 17:00:49 -0400
commita7d394b1eba76ce2faaf49e245235a2d9b4025c4 (patch)
treede30e52284139374321a61d7b57e0df7512ccd8f /actionpack
parenta078cf0189a80cce0e0d1a0371a4b8aa1115abb9 (diff)
parent7dbc6d6979aec1ce7364269360d277fa2499e919 (diff)
downloadrails-a7d394b1eba76ce2faaf49e245235a2d9b4025c4.tar.gz
rails-a7d394b1eba76ce2faaf49e245235a2d9b4025c4.tar.bz2
rails-a7d394b1eba76ce2faaf49e245235a2d9b4025c4.zip
Merge pull request #33118 from dan-jensen/fix-eager-load-lockup-bug-in-development
Fix bug with eager_load in development environment
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/routes.rb2
-rw-r--r--actionpack/test/journey/router_test.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/routes.rb b/actionpack/lib/action_dispatch/journey/routes.rb
index 639c063495..3ba8361d77 100644
--- a/actionpack/lib/action_dispatch/journey/routes.rb
+++ b/actionpack/lib/action_dispatch/journey/routes.rb
@@ -51,7 +51,7 @@ module ActionDispatch
def ast
@ast ||= begin
asts = anchored_routes.map(&:ast)
- Nodes::Or.new(asts) unless asts.empty?
+ Nodes::Or.new(asts)
end
end
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb
index 183f421bcf..1f4e14aef6 100644
--- a/actionpack/test/journey/router_test.rb
+++ b/actionpack/test/journey/router_test.rb
@@ -493,6 +493,15 @@ module ActionDispatch
assert_not called
end
+ def test_eager_load_with_routes
+ get "/foo-bar", to: "foo#bar"
+ assert_nil router.eager_load!
+ end
+
+ def test_eager_load_without_routes
+ assert_nil router.eager_load!
+ end
+
private
def get(*args)