stripe 1.30.1 → 1.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.txt +5 -1
- data/VERSION +1 -1
- data/lib/stripe/stripe_object.rb +1 -32
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/stripe_object_test.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a832c74b94a7a2346a38e3053363aa80f31b04d5
|
4
|
+
data.tar.gz: 2b0d72e9641fdde9d3a4db16e39407ceb33ecd6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 019e999e649b2f9e39dd0a900aec1b0b44ff19a740ea37663f67ca77749fc93f540b7c4c588e47e30ba050be9ffaca7a8e7d43ccbd518c1781bcc92c077fa3e7
|
7
|
+
data.tar.gz: 692e479177426a0b3974ffa7ed6d5725e01b40ddd61afd0c42fe133b764a0f6b3201afb387f8f17efe7a7d66ed1e5e06e892f21c37a88fc172cdde4d4a3b3700
|
data/History.txt
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
=== 1.30.2 2015-10-12
|
2
|
+
|
3
|
+
* Fix bug where `opts` didn't properly propagate to descendant `StripeObjects`
|
4
|
+
|
1
5
|
=== 1.30.1 2015-10-10
|
2
6
|
|
3
7
|
* Fix bug that prevent lists of hashes from being URI-encoded properly
|
4
|
-
* Fix bug where filter conditions were not making it
|
8
|
+
* Fix bug where filter conditions were not making it past the first instantiated `ListObject`
|
5
9
|
|
6
10
|
=== 1.30.0 2015-10-09
|
7
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.30.
|
1
|
+
1.30.2
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -333,7 +333,7 @@ module Stripe
|
|
333
333
|
@unsaved_values.delete(k)
|
334
334
|
end
|
335
335
|
|
336
|
-
update_attributes(values,
|
336
|
+
update_attributes(values, opts)
|
337
337
|
values.each do |k, _|
|
338
338
|
@transient_values.delete(k)
|
339
339
|
@unsaved_values.delete(k)
|
@@ -341,36 +341,5 @@ module Stripe
|
|
341
341
|
|
342
342
|
self
|
343
343
|
end
|
344
|
-
|
345
|
-
# Mass assigns attributes on the model.
|
346
|
-
#
|
347
|
-
# This is a version of +update_attributes+ that takes some extra options
|
348
|
-
# for internal use.
|
349
|
-
#
|
350
|
-
# ==== Options
|
351
|
-
#
|
352
|
-
# * +:opts:+ Options for StripeObject like an API key.
|
353
|
-
# * +:raise_error:+ Set to false to suppress ArgumentErrors on keys that
|
354
|
-
# don't exist.
|
355
|
-
def update_attributes_with_options(values, options={})
|
356
|
-
# `opts` are StripeObject options
|
357
|
-
opts = options.fetch(:opts, {})
|
358
|
-
raise_error = options.fetch(:raise_error, true)
|
359
|
-
|
360
|
-
values.each do |k, v|
|
361
|
-
if !@@permanent_attributes.include?(k) && !self.respond_to?(:"#{k}=")
|
362
|
-
if raise_error
|
363
|
-
raise ArgumentError,
|
364
|
-
"#{k} is not an attribute that can be assigned on this object"
|
365
|
-
else
|
366
|
-
next
|
367
|
-
end
|
368
|
-
end
|
369
|
-
|
370
|
-
@values[k] = Util.convert_to_stripe_object(v, opts)
|
371
|
-
@unsaved_values.add(k)
|
372
|
-
end
|
373
|
-
self
|
374
|
-
end
|
375
344
|
end
|
376
345
|
end
|
data/lib/stripe/version.rb
CHANGED
@@ -84,5 +84,20 @@ module Stripe
|
|
84
84
|
$stderr = old_stderr
|
85
85
|
end
|
86
86
|
end
|
87
|
+
|
88
|
+
should "pass opts down to children when initializing" do
|
89
|
+
opts = { :custom => "opts" }
|
90
|
+
|
91
|
+
# customer comes with a `sources` list that makes a convenient object to
|
92
|
+
# perform tests on
|
93
|
+
customer = Stripe::Customer.construct_from(make_customer, opts)
|
94
|
+
|
95
|
+
source = customer.sources.first
|
96
|
+
# Pulling `@opts` as an instance variable here is not ideal, but it's
|
97
|
+
# important enough argument that the test here is worth it. we should
|
98
|
+
# consider exposing it publicly on a future pull (and possibly renaming
|
99
|
+
# it to something more useful).
|
100
|
+
assert_equal opts, source.instance_variable_get(:@opts)
|
101
|
+
end
|
87
102
|
end
|
88
103
|
end
|
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.30.
|
4
|
+
version: 1.30.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ross Boucher
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10-
|
12
|
+
date: 2015-10-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|