Use ActiveSupport.on_load to extend ActionController and ActionView.
http://api.rubyonrails.org/classes/ActiveSupport/LazyLoadHooks.html https://github.com/rails/rails/blob/92703a9ea5d8b96f30e0b706b801c9185ef14f0e/actionpack/lib/action_controller/base.rb#L264 https://github.com/rails/rails/blob/7da8d76206271bdf200ea201f7e5a49afb9bc9e7/actionview/lib/action_view/base.rb#L215
This commit is contained in:
1 parent
3b8d33f97a
commit
46ddd15905
1 file changed
+7
-2
+7
-2
@@ -35,5 +35,10 @@ module RuCaptcha
|
||||
end
|
||||
end
|
||||
|
||||
ActionController::Base.send(:include, RuCaptcha::ControllerHelpers)
|
||||
ActionView::Base.send(:include, RuCaptcha::ViewHelpers)
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
ActionController::Base.send :include, RuCaptcha::ControllerHelpers
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:active_view) do
|
||||
include RuCaptcha::ViewHelpers
|
||||
end
|
||||
Reference in new issue
Block a user