stripe 1.20.2 → 1.20.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.20.2
1
+ 1.20.3
@@ -118,9 +118,12 @@ module Stripe
118
118
  end
119
119
  end
120
120
 
121
-
122
121
  def serialize_nested_object(key)
123
122
  new_value = @values[key]
123
+ if new_value.is_a?(APIResource)
124
+ return {}
125
+ end
126
+
124
127
  if @unsaved_values.include?(key)
125
128
  # the object has been reassigned
126
129
  # e.g. as object.key = {foo => bar}
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.20.2'
2
+ VERSION = '1.20.3'
3
3
  end
@@ -446,6 +446,21 @@ module Stripe
446
446
  acct.save
447
447
  end
448
448
 
449
+ should 'not save nested API resources' do
450
+ ch = Stripe::Charge.construct_from({
451
+ :id => 'charge_id',
452
+ :customer => {
453
+ :object => 'customer',
454
+ :id => 'customer_id'
455
+ }
456
+ })
457
+
458
+ @mock.expects(:post).once.with("#{Stripe.api_base}/v1/charges/charge_id", nil, '').returns(test_response({"id" => "charge_id"}))
459
+
460
+ ch.customer.description = 'Bob'
461
+ ch.save
462
+ end
463
+
449
464
  should 'correctly handle replaced nested objects' do
450
465
  acct = Stripe::Account.construct_from({
451
466
  :id => 'myid',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.2
4
+ version: 1.20.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-03-10 00:00:00.000000000 Z
13
+ date: 2015-03-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client