stripe/stripe-ruby — Issue #19: gems/activesupport-3.2.1/lib/active_support/core_ext/object/to_json.rb:15:in `to_json': wrong number of arguments (2 for 1) (ArgumentError)
Author: briancollins
Created: 2012-02-25 20:26:21+00:00
State: open

The following causes an ArgumentError in 1.9.2:

require 'active_record'
require 'stripe'

ActiveRecord::Base.establish_connection('adapter' => 'postgresql', 'host' => 'localhost')
Stripe.api_key = "SNIP"
puts Stripe::Customer.all.inspect

=> ArgumentError

This monkey-patch "fixes":

module Stripe
class StripeObject
def to_json(*a)
@values.to_json(*a)
rescue ArgumentError
@values.to_json
end
end
end