Skip to content

Commit 3de6a75

Browse files
committed
Merge pull request rails#6036 from carlosantoniodasilva/routes-reloader-refactor
Remove some warnings and minor refactor in RoutesReloader
2 parents 75df4c1 + 72a2edd commit 3de6a75

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

railties/lib/rails/application.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ def inherited(base)
6666
end
6767
end
6868

69-
attr_accessor :assets, :sandbox, :queue
69+
attr_accessor :assets, :sandbox
7070
alias_method :sandbox?, :sandbox
7171
attr_reader :reloaders
72+
attr_writer :queue
7273

7374
delegate :default_url_options, :default_url_options=, :to => :routes
7475

railties/lib/rails/application/routes_reloader.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ def reload!
2424

2525
def updater
2626
@updater ||= begin
27-
dirs = @external_routes.inject({}) do |hash, dir|
28-
hash.merge(dir.to_s => ["rb"])
27+
dirs = @external_routes.each_with_object({}) do |dir, hash|
28+
hash[dir.to_s] = %w(rb)
2929
end
3030

3131
updater = ActiveSupport::FileUpdateChecker.new(paths, dirs) { reload! }
32-
3332
updater.execute
3433
updater
3534
end

railties/test/application/routing_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ def baz
249249
assert_equal 404, last_response.status
250250
end
251251
end
252-
end
253252

254-
{"development" => "baz", "production" => "bar"}.each do |mode, expected|
255253
test "reloads routes when configuration is changed in #{mode}" do
256254
controller :foo, <<-RUBY
257255
class FooController < ApplicationController

railties/test/isolation/abstract_unit.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# These files do not require any others and are needed
1919
# to run the tests
2020
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/isolation"
21-
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/declarative"
2221
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/core_ext/kernel/reporting"
2322

2423
module TestHelpers
@@ -268,7 +267,6 @@ class ActiveSupport::TestCase
268267
include TestHelpers::Paths
269268
include TestHelpers::Rack
270269
include TestHelpers::Generation
271-
extend ActiveSupport::Testing::Declarative
272270
end
273271

274272
# Create a scope and build a fixture rails app

0 commit comments

Comments
 (0)