stripe-rails 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ ## 0.2.2 (2012-01-09)
2
+ * bugfix allowing creation of coupons without max_redemptions
3
+
1
4
  ## 0.2.1 (2012-12-17)
2
5
  * manage coupons with config/stripe/coupons.rb
3
6
 
@@ -17,4 +20,4 @@
17
20
 
18
21
  ## 0.0.1 (2012-10-12)
19
22
 
20
- * basic railtie
23
+ * basic railtie
@@ -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, :greater_than => 0
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
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module Rails
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -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.plan(:bad) {}}.must_raise Stripe::InvalidConfigurationError
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.1
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: 2012-12-17 00:00:00.000000000 Z
12
+ date: 2013-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails