Check for @values in StripeObject#method_not_found

If a StripeObject is being deserialized by psych, @values.has_key? is
called before @values is initialized which prevents proper
deserialization from occurring. Checking for existence first resolves
the issue.
This commit is contained in:
Matt Colyer 2014-02-24 14:16:21 -08:00
parent 637d5899f6
commit 974f5ce425

View File

@ -181,7 +181,7 @@ module Stripe
end
def respond_to_missing?(symbol, include_private = false)
@values.has_key?(symbol) || super
@values && @values.has_key?(symbol) || super
end
end
end