Module: RoutesLazyRoutes
- Defined in:
- lib/routes_lazy_routes.rb,
lib/routes_lazy_routes/railtie.rb,
lib/routes_lazy_routes/version.rb,
lib/routes_lazy_routes/application.rb,
lib/routes_lazy_routes/lazy_routes_middleware.rb,
lib/routes_lazy_routes/routes_reloader_wrapper.rb
Defined Under Namespace
Modules: Application Classes: LazyRoutesMiddleware, Railtie, RoutesReloaderWrapper
Constant Summary collapse
- VERSION =
'0.4.3'
Class Method Summary collapse
-
.arise! ⇒ Object
The root of evil.
-
.eager_load! ⇒ Object
The load runner.
Class Method Details
.arise! ⇒ Object
The root of evil
11 12 13 14 15 16 17 18 19 |
# File 'lib/routes_lazy_routes.rb', line 11 def arise! Rails::Application::RoutesReloader.class_eval do class << self def new RoutesLazyRoutes::RoutesReloaderWrapper.new super end end end end |
.eager_load! ⇒ Object
The load runner
22 23 24 25 26 |
# File 'lib/routes_lazy_routes.rb', line 22 def eager_load! if RoutesLazyRoutes::RoutesReloaderWrapper === (reloader = Rails.application.routes_reloader) reloader.reload! end end |