Skip to content

Commit 097d0f1

Browse files
authored
Merge pull request rails#52406 from Shopify/revert_52303
Revert rails#52303
2 parents 91f0bc4 + 561b6ce commit 097d0f1

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

actionpack/lib/action_dispatch/railtie.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class Railtie < Rails::Railtie # :nodoc:
6868
config.action_dispatch.always_write_cookie = Rails.env.development? if config.action_dispatch.always_write_cookie.nil?
6969
ActionDispatch::Cookies::CookieJar.always_write_cookie = config.action_dispatch.always_write_cookie
7070

71+
ActionDispatch::Routing::Mapper.route_source_locations = Rails.env.development?
72+
7173
ActionDispatch::Http::Cache::Request.strict_freshness = app.config.action_dispatch.strict_freshness
7274
ActionDispatch.test_app = app
7375
end

actionpack/lib/action_dispatch/routing/mapper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
require "active_support/core_ext/enumerable"
77
require "active_support/core_ext/array/extract_options"
88
require "active_support/core_ext/regexp"
9-
require "action_dispatch/routing"
109
require "action_dispatch/routing/redirection"
1110
require "action_dispatch/routing/endpoint"
1211

railties/CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@
5454

5555
*Jerome Dalbert*, *Haroon Ahmed*
5656

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-
6257
* Deprecate `bin/rake stats` in favor of `bin/rails stats`.
6358

6459
*Juan Vásquez*

railties/lib/rails/commands/routes/routes_command.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ def invoke_command(*)
2222

2323
desc "routes", "List all the defined routes"
2424
def perform(*)
25-
require "action_dispatch/routing/mapper"
26-
ActionDispatch::Routing::Mapper.route_source_locations = true
2725
boot_application!
2826
require "action_dispatch/routing/inspector"
2927

railties/test/commands/routes_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,6 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
403403
assert_includes(output, "No unused routes found.")
404404
end
405405

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-
412406
private
413407
def run_routes_command(args = [])
414408
rails "routes", args

0 commit comments

Comments
 (0)