lib/gon.rb in gon-5.0.3 vs lib/gon.rb in gon-5.0.4
- old
+ new
@@ -23,10 +23,10 @@
def method_missing(method, *args, &block)
if method.to_s =~ /=$/
if public_method_name?(method)
raise 'You can\'t use Gon public methods for storing data'
end
- unless current_gon
+ if self == Gon && !current_gon
raise 'Assign request-specific gon variables only through `gon` helper, not through Gon constant'
end
set_variable(method.to_s.delete('='), args[0])
else