lib/gon/spec_helpers.rb in gon-5.1.2 vs lib/gon/spec_helpers.rb in gon-5.2.0

- old
+ new

@@ -5,11 +5,14 @@ module ClassMethods module GonSession def process(*) # preload threadlocal & store controller instance - controller.gon - Gon.send(:current_gon).env[Gon::Base::ENV_CONTROLLER_KEY] = controller + if controller.is_a? ActionController::Base + controller.gon + Gon.send(:current_gon).env[Gon::Base::ENV_CONTROLLER_KEY] = + controller + end super end end def new(*)