stripe-rails 0.2.1 → 0.2.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.
- data/Changelog.md +4 -1
- data/lib/stripe/coupons.rb +2 -2
- data/lib/stripe/rails/version.rb +1 -1
- data/test/coupon_builder_spec.rb +1 -1
- metadata +2 -2
data/Changelog.md
CHANGED
data/lib/stripe/coupons.rb
CHANGED
@@ -11,7 +11,7 @@ module Stripe
|
|
11
11
|
validates_inclusion_of :percent_off, in: 1..100, unless: ->(coupon) {coupon.percent_off.nil?}
|
12
12
|
validates_numericality_of :percent_off, :greater_than => 0
|
13
13
|
validates_numericality_of :duration_in_months, :greater_than => 0, :if => :repeating?
|
14
|
-
validates_numericality_of :max_redemptions, :
|
14
|
+
validates_numericality_of :max_redemptions, greater_than: 0, unless: ->(coupon) {coupon.max_redemptions.nil?}
|
15
15
|
|
16
16
|
def initialize(*args)
|
17
17
|
super
|
@@ -35,4 +35,4 @@ module Stripe
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
end
|
38
|
+
end
|
data/lib/stripe/rails/version.rb
CHANGED
data/test/coupon_builder_spec.rb
CHANGED
@@ -58,7 +58,7 @@ describe 'building plans' do
|
|
58
58
|
|
59
59
|
describe 'with missing mandatory values' do
|
60
60
|
it 'raises an exception after configuring it' do
|
61
|
-
proc {Stripe.
|
61
|
+
proc {Stripe.coupon(:bad) {}}.must_raise Stripe::InvalidConfigurationError
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|