stripe_local 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de1cf4073d0c2a60342b375ffcd4db901b98cf2e
4
- data.tar.gz: 689d638bdd50af7d5874f7aa7552d11804e6411a
3
+ metadata.gz: a6ddf5da1efbd7a25f9c061e1dc47923411cd7c4
4
+ data.tar.gz: a641840f2f76bde8e9469d2f2603515d342aac56
5
5
  SHA512:
6
- metadata.gz: 3369f864762dd9149dcfad8dbe8d1b2e7ff04d15c08852f8210332f6b4419400dbbb6ca27aa77e8113df084f839f1f4c5be330173fcfff95022ba1fe50aec9ac
7
- data.tar.gz: 3c957fd52518a8b0eba8f4842712997949e8c69ca9c7fb3ee5433f6b39a527f0dda6a0495fa944b8623328fd8f76f69200cb1b45ba4a0ba3449b06d18d957fd2
6
+ metadata.gz: e107c6834e23d3834532c0aaa5d3e70eaef925b7ddc2148919d635f0dccca08d16415b0a94a69b28f0895ec77eeb2b01637c3dd7ace4a493fbf87967a2ecc641
7
+ data.tar.gz: 6363e679a8503ebdfa65adf86448bbfc6f0d9a8096b623d3763f8961dcbd75117aab26e96d1250527ab559782cd41a881016570a6a9721e83ff018493843757c
@@ -1,6 +1,6 @@
1
1
  module StripeLocal
2
2
  class Card < ActiveRecord::Base
3
- primary_key = :id
3
+ self.primary_key = :id
4
4
 
5
5
  has_many :charges, inverse_of: :card
6
6
  belongs_to :customer, inverse_of: :cards
@@ -2,6 +2,8 @@ module StripeLocal
2
2
  class Coupon < ActiveRecord::Base
3
3
  include ObjectAdapter
4
4
 
5
+ self.primary_key = :id
6
+
5
7
  time_writer :redeem_by
6
8
 
7
9
 
@@ -1,3 +1,3 @@
1
1
  module StripeLocal
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/stripe_local.rb CHANGED
@@ -50,6 +50,10 @@ module StripeLocal
50
50
  StripeLocal::Customer.create( {model_id: self.id}.merge customer.to_hash )
51
51
  end
52
52
 
53
+ def customer
54
+ @customer ||= StripeLocal::Customer.find_by( model_id: id )
55
+ end
56
+
53
57
  def method_missing method, *args, &block
54
58
  if self.customer.present? && self.customer.respond_to?( method )
55
59
  self.customer.send method, *args, &block