We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b3f2d9 commit d569dc3Copy full SHA for d569dc3
lib/gon.rb
@@ -48,7 +48,7 @@ def request=(request_id)
48
49
def method_missing(m, *args, &block)
50
if ( m.to_s =~ /=$/ )
51
- if public_methods.include? m.to_s[0..-2].to_sym
+ if public_methods.include?(RUBY_VERSION =~ /1.9/ ? m.to_s[0..-2].to_sym : m.to_s[0..-2])
52
raise "You can't use Gon public methods for storing data"
53
end
54
set_variable(m.to_s.delete('='), args[0])
spec/gon/gon_spec.rb
@@ -62,6 +62,7 @@
62
it 'returns exception if try to set public method as variable' do
63
Gon.clear
64
lambda { Gon.all_variables = 123 }.should raise_error
65
+ lambda { Gon.rabl = 123 }.should raise_error
66
67
68
context 'render json from rabl template' do
0 commit comments