aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/routes_reloader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/application/routes_reloader.rb')
-rw-r--r--railties/lib/rails/application/routes_reloader.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb
index d861d27465..fe0cfb7801 100644
--- a/railties/lib/rails/application/routes_reloader.rb
+++ b/railties/lib/rails/application/routes_reloader.rb
@@ -1,7 +1,11 @@
module Rails
class Application
+ # TODO Write tests for this behavior extracted from Application
class RoutesReloader
- # TODO Write tests for this behavior extracted from Application
+ def self.paths
+ @paths ||= []
+ end
+
def initialize(config)
@config, @last_change_at = config, nil
end
@@ -9,7 +13,7 @@ module Rails
def changed_at
routes_changed_at = nil
- paths.each do |path|
+ self.class.paths.each do |path|
config_changed_at = File.stat(path).mtime
if routes_changed_at.nil? || config_changed_at > routes_changed_at
@@ -25,7 +29,7 @@ module Rails
routes.disable_clear_and_finalize = true
routes.clear!
- paths.each { |path| load(path) }
+ self.class.paths.each { |path| load(path) }
routes.finalize!
nil
@@ -40,10 +44,6 @@ module Rails
reload!
end
end
-
- def paths
- @config.action_dispatch.route_paths
- end
end
end
end \ No newline at end of file