Skip to content

Commit

Permalink
Lazy load ActionController::Base (fnando#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagletmt authored and fnando committed Feb 27, 2018
1 parent da97f81 commit a1dbede
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/browser/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ class Railtie < Rails::Railtie
config.browser = ActiveSupport::OrderedOptions.new

initializer "browser" do
::ActionController::Base.send :include, Browser::ActionController
Browser::Middleware::Context.send :include,
Browser::Middleware::Context::Additions
ActiveSupport.on_load(:action_controller) do
::ActionController::Base.send :include, Browser::ActionController
Browser::Middleware::Context.send(
:include,
Browser::Middleware::Context::Additions
)
end
end
end
end

0 comments on commit a1dbede

Please sign in to comment.