File tree Expand file tree Collapse file tree 5 files changed +2
-14
lines changed
actionpack/lib/action_dispatch
lib/rails/commands/routes Expand file tree Collapse file tree 5 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ class Railtie < Rails::Railtie # :nodoc:
68
68
config . action_dispatch . always_write_cookie = Rails . env . development? if config . action_dispatch . always_write_cookie . nil?
69
69
ActionDispatch ::Cookies ::CookieJar . always_write_cookie = config . action_dispatch . always_write_cookie
70
70
71
+ ActionDispatch ::Routing ::Mapper . route_source_locations = Rails . env . development?
72
+
71
73
ActionDispatch ::Http ::Cache ::Request . strict_freshness = app . config . action_dispatch . strict_freshness
72
74
ActionDispatch . test_app = app
73
75
end
Original file line number Diff line number Diff line change 6
6
require "active_support/core_ext/enumerable"
7
7
require "active_support/core_ext/array/extract_options"
8
8
require "active_support/core_ext/regexp"
9
- require "action_dispatch/routing"
10
9
require "action_dispatch/routing/redirection"
11
10
require "action_dispatch/routing/endpoint"
12
11
Original file line number Diff line number Diff line change 54
54
55
55
* Jerome Dalbert* , * Haroon Ahmed*
56
56
57
- * Enable tracking route source locations only when using routes command. Previously,
58
- it was enabled in development mode, but is only needed for ` bin/rails routes -E ` .
59
-
60
- * Gannon McGibbon*
61
-
62
57
* Deprecate ` bin/rake stats ` in favor of ` bin/rails stats ` .
63
58
64
59
* Juan Vásquez*
Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ def invoke_command(*)
22
22
23
23
desc "routes" , "List all the defined routes"
24
24
def perform ( *)
25
- require "action_dispatch/routing/mapper"
26
- ActionDispatch ::Routing ::Mapper . route_source_locations = true
27
25
boot_application!
28
26
require "action_dispatch/routing/inspector"
29
27
Original file line number Diff line number Diff line change @@ -403,12 +403,6 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
403
403
assert_includes ( output , "No unused routes found." )
404
404
end
405
405
406
- test "route source locations aren't included when booted normally" do
407
- output = rails "runner" , "print !!ActionDispatch::Routing::Mapper.route_source_locations"
408
-
409
- assert_equal ( "false" , output )
410
- end
411
-
412
406
private
413
407
def run_routes_command ( args = [ ] )
414
408
rails "routes" , args
You can’t perform that action at this time.
0 commit comments