diff --git a/lib/stripe/stripe_object.rb b/lib/stripe/stripe_object.rb index 1b05d059..aa95c42b 100644 --- a/lib/stripe/stripe_object.rb +++ b/lib/stripe/stripe_object.rb @@ -329,14 +329,6 @@ module Stripe when nil '' - # The logic here is that essentially any object embedded in another - # object that had a `type` is actually an API resource of a different - # type that's been included in the response. These other resources must - # be updated from their proper endpoints, and therefore they are not - # included when serializing even if they've been modified. - when APIResource - nil - when Array update = value.map { |v| serialize_params_value(v, nil, true, force) } diff --git a/test/stripe/api_resource_test.rb b/test/stripe/api_resource_test.rb index 09a6ebfa..85201218 100644 --- a/test/stripe/api_resource_test.rb +++ b/test/stripe/api_resource_test.rb @@ -551,21 +551,6 @@ module Stripe acct.save end - should 'not save nested API resources' do - ch = Stripe::Charge.construct_from({ - :id => 'charge_id', - :customer => { - :object => 'customer', - :id => 'customer_id' - } - }) - - @mock.expects(:post).once.with("#{Stripe.api_base}/v1/charges/charge_id", nil, '').returns(make_response({"id" => "charge_id"})) - - ch.customer.description = 'Bob' - ch.save - end - should 'correctly handle replaced nested objects' do acct = Stripe::Account.construct_from({ :id => 'myid', diff --git a/test/stripe/stripe_object_test.rb b/test/stripe/stripe_object_test.rb index 9451468f..bf105f37 100644 --- a/test/stripe/stripe_object_test.rb +++ b/test/stripe/stripe_object_test.rb @@ -240,15 +240,6 @@ module Stripe assert_equal([{ :foo => "bar" }], serialized[:metadata]) end - should "#serialize_params and remove embedded APIResources" do - obj = Stripe::StripeObject.construct_from({ - :customer => Customer.construct_from({}) - }) - - serialized = obj.serialize_params - assert_equal({}, serialized) - end - should "#serialize_params takes a force option" do obj = Stripe::StripeObject.construct_from({ :id => 'id',