aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJonathan Boler <galatians@gmail.com>2018-06-04 12:56:36 -0500
committerJonathan Boler <galatians@gmail.com>2018-06-04 12:56:36 -0500
commite7758b8b68e33ca770fcedec0ae66e636276be08 (patch)
treef2b23d60c9afd642ba02d109897aff3efacf6d27 /railties
parentb25a6843893a2ecc5eaab290e10e4f0b38157f8e (diff)
downloadrails-e7758b8b68e33ca770fcedec0ae66e636276be08.tar.gz
rails-e7758b8b68e33ca770fcedec0ae66e636276be08.tar.bz2
rails-e7758b8b68e33ca770fcedec0ae66e636276be08.zip
Eager load routes on rebuild
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application/routes_reloader.rb16
1 files changed, 2 insertions, 14 deletions
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb
index 2ef09b4162..916988a651 100644
--- a/railties/lib/rails/application/routes_reloader.rb
+++ b/railties/lib/rails/application/routes_reloader.rb
@@ -7,7 +7,7 @@ module Rails
class RoutesReloader
attr_reader :route_sets, :paths
attr_accessor :eager_load
- delegate :updated?, to: :updater
+ delegate :execute_if_updated, :execute, :updated?, to: :updater
def initialize
@paths = []
@@ -19,23 +19,11 @@ module Rails
clear!
load_paths
finalize!
+ route_sets.each(&:eager_load!) if eager_load
ensure
revert
end
- def execute
- ret = updater.execute
- route_sets.each(&:eager_load!) if eager_load
- ret
- end
-
- def execute_if_updated
- if updated = updater.execute_if_updated
- route_sets.each(&:eager_load!) if eager_load
- end
- updated
- end
-
private
def updater