Use `ActiveSupport.on_load` to extend ActionController and ActionView.
http://api.rubyonrails.org/classes/ActiveSupport/LazyLoadHooks.html92703a9ea5/actionpack/lib/action_controller/base.rb (L264)
7da8d76206/actionview/lib/action_view/base.rb (L215)
This commit is contained in:
parent
3b8d33f97a
commit
46ddd15905
|
@ -35,5 +35,10 @@ module RuCaptcha
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionController::Base.send(:include, RuCaptcha::ControllerHelpers)
|
ActiveSupport.on_load(:action_controller) do
|
||||||
ActionView::Base.send(:include, RuCaptcha::ViewHelpers)
|
ActionController::Base.send :include, RuCaptcha::ControllerHelpers
|
||||||
|
end
|
||||||
|
|
||||||
|
ActiveSupport.on_load(:active_view) do
|
||||||
|
include RuCaptcha::ViewHelpers
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue