stripe_local 0.1.3 → 0.2.0

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: 78e942b16448c6c2cda74357a3611417424b4174
4
- data.tar.gz: 21a11867d73d77ccae4a8af88793576d8e82e22a
3
+ metadata.gz: c9a6d6bf6b27b5da7149cfaf9dcd392bc9fa8bd2
4
+ data.tar.gz: 99eb42aa30970acda0afc4057ca4065c374dd092
5
5
  SHA512:
6
- metadata.gz: da405a0cb34f085f91bce8974dcee58ad457d6b19c8bafd5540bdc4338a3368fe93b6a76559bd9f10bfa8040583eecf0686baa74d09aa69102949df93764a7b3
7
- data.tar.gz: 5b2e13e3cb0020fe346eaa5a924b5e231835e97bb1451d9981998efca629063bcc754ff3c0da970a77def3bb45891a2aa09874a5609903980f3cad634941f62c
6
+ metadata.gz: 37070a90380faa87d282b80aff7cb093f4010915435dce54154d41337c3b55d402bdb75599152e5cfc68ca5b8cc7643c793b9e206b4225eddeb047e472cb5dbe
7
+ data.tar.gz: f1edb5c48aaa9c8fe2c15c24ff0b7fa8aa592dd4ce77f403e05e0d9860e5968ba9c288fa6e17fb059c59463c3d8cc16b7d545f5bdd88af289cd138c5babaf9a5
@@ -6,6 +6,8 @@ module StripeLocal
6
6
 
7
7
  time_writer :redeem_by
8
8
 
9
+ has_many :discounts, inverse_of: :coupon
10
+ has_many :customers, through: :discounts, source: :customer
9
11
 
10
12
  #=!=#>>>
11
13
  # string :id
@@ -4,21 +4,26 @@ module StripeLocal
4
4
 
5
5
  self.primary_key = :id
6
6
 
7
- belongs_to :model, inverse_of: :customer,
8
- foreign_key: "model_id",
9
- class_name: "::#{StripeLocal::model_class}"
7
+ belongs_to :model, inverse_of: :customer,
8
+ foreign_key: "model_id",
9
+ class_name: "::#{StripeLocal::model_class}"
10
10
 
11
- has_many :cards, inverse_of: :customer, class_name: 'StripeLocal::Card'
11
+ has_many :cards, inverse_of: :customer,
12
+ class_name: 'StripeLocal::Card'
12
13
 
13
- has_many :invoices, inverse_of: :customer
14
+ has_many :invoices, inverse_of: :customer,
15
+ class_name: 'StripeLocal::Invoice'
14
16
 
15
- has_many :charges, inverse_of: :customer
17
+ has_many :charges, inverse_of: :customer,
18
+ class_name: 'StripeLocal::Charge'
16
19
 
17
- has_one :subscription, inverse_of: :customer
20
+ has_one :subscription, inverse_of: :customer,
21
+ class_name: 'StripeLocal::Subscription'
18
22
 
19
23
  has_one :plan, through: :subscription,
20
24
  inverse_of: :members,
21
- source: :plan
25
+ source: :plan,
26
+ class_name: 'StripeLocal::Card'
22
27
 
23
28
  class<<self
24
29
 
@@ -4,6 +4,9 @@ module StripeLocal
4
4
 
5
5
  time_writer :start, :end
6
6
 
7
+ belongs_to :customer, inverse_of: :discount
8
+ belongs_to :coupon, inverse_of: :discount
9
+
7
10
  class<<self
8
11
  def create object
9
12
  super normalize object
@@ -41,6 +41,15 @@ module StripeLocal
41
41
  def fail inv
42
42
  #TODO: implement this
43
43
  end
44
+
45
+ def paid
46
+ where paid: true
47
+ end
48
+
49
+ def unpaid
50
+ where paid: false
51
+ end
52
+ alias :failed :unpaid
44
53
  end
45
54
 
46
55
 
@@ -5,9 +5,12 @@ module StripeLocal
5
5
  self.primary_key = :id
6
6
 
7
7
  has_many :subscriptions, inverse_of: :plan
8
- has_many :members, through: :subscriptions,
9
- inverse_of: :plan,
8
+ has_many :line_items, inverse_of: :plan
9
+ has_many :members, through: :subscriptions,
10
+ inverse_of: :plan,
10
11
  source: :customer
12
+ has_many :invoices, through: :line_items,
13
+ source: :invoice
11
14
 
12
15
  class<<self
13
16
  def create object
@@ -6,6 +6,9 @@ module StripeLocal
6
6
 
7
7
  time_writer :created, :available_on
8
8
 
9
+
10
+ belongs_to :source, polymorphic: true
11
+
9
12
  class<<self
10
13
  def create object
11
14
  super normalize( object )
@@ -26,6 +29,14 @@ module StripeLocal
26
29
  end
27
30
  end
28
31
  end
32
+
33
+ def pending
34
+ where 'available_on < ?', Time.now
35
+ end
36
+
37
+ def available
38
+ where 'available_on > ?', Time.now
39
+ end
29
40
  end
30
41
 
31
42
 
@@ -0,0 +1,51 @@
1
+ module StripeLocal
2
+ module AssociationMethods
3
+ def customer
4
+ @customer ||= StripeLocal::Customer.find_by( model_id: id )
5
+ end
6
+
7
+ def subscription
8
+ @subscription ||= StripeLocal::Subscription.find_by( customer_id: customer.id )
9
+ end
10
+
11
+ def cards
12
+ @cards ||= StripeLocal::Card.where( customer_id: customer.id )
13
+ end
14
+
15
+ def plan
16
+ @plan ||= StripeLocal::Plan.find_by( id: subscription.plan_id )
17
+ end
18
+
19
+ def discount
20
+ @discount ||= StripeLocal::Discount.find_by( customer_id: customer.id )
21
+ end
22
+
23
+ def coupon
24
+ @coupon ||= StripeLocal::Coupon.find_by( id: discount.coupon_id )
25
+ end
26
+
27
+ def invoices
28
+ @invoices ||= StripeLocal::Invoice.where( customer_id: customer.id ).order( date: :desc )
29
+ end
30
+
31
+ def paid_invoices
32
+ invoices.paid
33
+ end
34
+
35
+ def charges
36
+ @charges ||= StripeLocal::Charge.where( customer_id: customer.id ).order( created: :desc )
37
+ end
38
+
39
+ def transactions
40
+ @transactions ||= StripeLocal::Transaction.where( source: charges ).order( created: :desc )
41
+ end
42
+
43
+ def pending_transactions
44
+ transactions.pending
45
+ end
46
+
47
+ def available_transactions
48
+ transactions.available
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,49 @@
1
+ module StripeLocal
2
+ module InstanceDelegation
3
+ #=!=#
4
+ # ==this is the primary interface for subscribing.
5
+ #
6
+ # [params]
7
+ # * +card+ (required) -> the token returned by stripe.js
8
+ # * +plan+ (required) -> the id of the plan being subscribed to
9
+ # * +email+ (optional) -> the client's email address
10
+ # * +description+ (optional) -> a description to attach to the stripe object for future reference
11
+ # * +coupon+ (optional) -> the id of a coupon if the subscription should be discounted
12
+ # * +lines+ (optional) -> an array of (amount,description) tuples
13
+ #
14
+ # :card => "tok_abc123",
15
+ # :plan => "MySaaS",
16
+ # :email => subscriber.email,
17
+ # :description => "a one year subscription to our flagship service at $99.00 per month"
18
+ # :lines => [
19
+ # [ 20000, "a one time setup fee of $200.00 for new members" ]
20
+ # ]
21
+ #=¡=#
22
+ def signup params
23
+ plan = params.delete( :plan )
24
+ lines = params.delete( :lines ) || []
25
+
26
+ _customer_ = Stripe::Customer.create( params )
27
+
28
+ lines.each do |(amount,desc)|
29
+ _customer_.add_invoice_item({currency: 'usd', amount: amount, description: desc})
30
+ end
31
+ _customer_.update_subscription({ plan: plan })
32
+
33
+ StripeLocal::Customer.create( {model_id: self.id}.merge _customer_.to_hash )
34
+ end
35
+
36
+
37
+ def method_missing method, *args, &block
38
+ if customer && customer.respond_to?( method )
39
+ customer.send method, *args, &block
40
+ else
41
+ super
42
+ end
43
+ end
44
+ def respond_to_missing? method, include_private = false
45
+ customer && customer.respond_to?( method ) || super
46
+ end
47
+ end
48
+
49
+ end
@@ -1,3 +1,3 @@
1
1
  module StripeLocal
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/stripe_local.rb CHANGED
@@ -1,71 +1,21 @@
1
1
  require "stripe_local/engine"
2
2
  require "stripe_local/webhook"
3
+ require "stripe_local/instance_delegation"
4
+ require "stripe_local/association_methods"
3
5
 
4
- module StripeLocal
5
6
 
7
+ module StripeLocal
6
8
  mattr_accessor :model_class
7
9
 
8
10
  def stripe_customer
9
- StripeLocal::model_class = self
10
- has_one :customer, inverse_of: :model, class_name: 'StripeLocal::Customer', foreign_key: :model_id
11
- include InstanceMethods
12
- end
13
-
14
- module InstanceMethods
15
-
16
- #=!=#>>>
17
- #
18
- # this is the primary interface for subscribing.
19
- #
20
- # [params]
21
- # * +card+ (required) -> the token returned by stripe.js
22
- # * +plan+ (required) -> the id of the plan being subscribed to
23
- # * +email+ (optional) -> the client's email address
24
- # * +description+ (optional) -> a description to attach to the stripe object for future reference
25
- # * +coupon+ (optional) -> the id of a coupon if the subscription should be discounted
26
- # * +lines+ (optional) -> an array of (amount,description) tuples
27
- # ```
28
- # :card => "tok_abc123",
29
- # :plan => "MySaaS",
30
- # :email => subscriber.email,
31
- # :description => "a one year subscription to our flagship service at $99.00 per month"
32
- # :lines => [
33
- # [ 20000, "a one time setup fee of $200.00 for new members" ]
34
- # ]
35
- # ```
36
- #=¡=#>>>
37
-
38
- def signup params
39
- plan = params.delete( :plan )
40
- lines = params.delete( :lines ) || []
11
+ include InstanceDelegation
12
+ include AssociationMethods
41
13
 
42
- customer = Stripe::Customer.create( params )
43
-
44
- lines.each do |item|
45
- customer.add_invoice_item( {currency: 'usd'}.merge item )
46
- end
47
-
48
- customer.update_subscription({ plan: plan })
49
-
50
- StripeLocal::Customer.create( {model_id: self.id}.merge customer.to_hash )
51
- end
52
-
53
- def customer
54
- StripeLocal::Customer.find_by( model_id: id )
55
- end
56
-
57
- def method_missing method, *args, &block
58
- if self.customer && self.customer.respond_to?( method )
59
- self.customer.send method, *args, &block
60
- else
61
- super
62
- end
63
- end
64
-
65
- def respond_to_missing? method, include_private = false
66
- self.customer && self.customer.respond_to?( method ) || super
67
- end
14
+ has_one :customer, inverse_of: :model,
15
+ foreign_key: :model_id,
16
+ class_name: 'StripeLocal::Customer'
68
17
 
18
+ StripeLocal::model_class = self
69
19
  end
70
20
  end
71
21
 
@@ -20833,3 +20833,336 @@ Migrating to LoadStripeTables (20131122063517)
20833
20833
   (0.3ms) COMMIT
20834
20834
  StripeLocal::Customer Load (0.4ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
20835
20835
  StripeLocal::Subscription Load (0.7ms) SELECT "stripe_local_subscriptions".* FROM "stripe_local_subscriptions" WHERE "stripe_local_subscriptions"."customer_id" = $1 ORDER BY "stripe_local_subscriptions"."id" ASC LIMIT 1 [["customer_id", "cus_123"]]
20836
+  (1.6ms) ALTER TABLE "stripe_local_discounts" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_cards" DISABLE TRIGGER ALL;ALTER TABLE "clients" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_customers" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_transfers" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_subscriptions" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_invoices" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_plans" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_line_items" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_charges" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_coupons" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_transactions" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_balances" DISABLE TRIGGER ALL
20837
+  (4.1ms) select table_name from information_schema.views where table_schema = 'dummy_test'
20838
+  (86.8ms) TRUNCATE TABLE "stripe_local_discounts", "stripe_local_cards", "clients", "stripe_local_customers", "stripe_local_transfers", "stripe_local_subscriptions", "stripe_local_invoices", "stripe_local_plans", "stripe_local_line_items", "stripe_local_charges", "stripe_local_coupons", "stripe_local_transactions", "stripe_local_balances" RESTART IDENTITY CASCADE;
20839
+  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_discounts" ENABLE TRIGGER ALL;ALTER TABLE "clients" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_customers" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_transfers" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_cards" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_subscriptions" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_invoices" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_plans" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_line_items" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_charges" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_coupons" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_transactions" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_balances" ENABLE TRIGGER ALL
20840
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
20841
+ StripeLocal::Customer Load (0.4ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20842
+  (0.1ms) BEGIN
20843
+ StripeLocal::Customer Load (0.3ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20844
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20845
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20846
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20847
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20848
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20849
+ StripeLocal::Customer Load (0.1ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20850
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20851
+ SQL (5.9ms) INSERT INTO "clients" ("created_at", "email", "name", "password", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:13:26 CST -06:00], ["email", "test@test.com"], ["name", "Test Case"], ["password", "password"], ["updated_at", Sat, 30 Nov 2013 15:13:26 CST -06:00]]
20852
+  (0.3ms) COMMIT
20853
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
20854
+  (0.2ms) BEGIN
20855
+ SQL (2.9ms) INSERT INTO "stripe_local_cards" ("brand", "created_at", "customer_id", "cvc_check", "exp_month", "exp_year", "id", "last4", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["brand", "Visa"], ["created_at", Sat, 30 Nov 2013 15:13:26 CST -06:00], ["customer_id", "cus_123"], ["cvc_check", "pass"], ["exp_month", 8], ["exp_year", 2014], ["id", "card_102Y2J1Cmf55uWiejglofO7j"], ["last4", "4242"], ["name", "Test Case"], ["updated_at", Sat, 30 Nov 2013 15:13:26 CST -06:00]]
20856
+  (0.4ms) COMMIT
20857
+  (0.2ms) BEGIN
20858
+ SQL (1.1ms) INSERT INTO "stripe_local_subscriptions" ("created_at", "current_period_end", "current_period_start", "customer_id", "plan_id", "start", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:13:26 CST -06:00], ["current_period_end", Thu, 10 Oct 2013 13:52:04 CDT -05:00], ["current_period_start", Tue, 10 Sep 2013 13:52:04 CDT -05:00], ["customer_id", "cus_123"], ["plan_id", "GIN100"], ["start", Tue, 10 Sep 2013 13:52:04 CDT -05:00], ["status", "active"], ["updated_at", Sat, 30 Nov 2013 15:13:26 CST -06:00]]
20859
+  (0.3ms) COMMIT
20860
+  (0.1ms) BEGIN
20861
+ SQL (0.8ms) INSERT INTO "stripe_local_customers" ("account_balance", "created_at", "default_card", "delinquent", "description", "email", "id", "model_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["account_balance", 0], ["created_at", Sat, 30 Nov 2013 15:13:26 CST -06:00], ["default_card", "card_102Y2J1Cmf55uWiejglofO7j"], ["delinquent", false], ["description", "On September 10th, Test signed up for CA50."], ["email", "test@test.com"], ["id", "cus_123"], ["model_id", 1], ["updated_at", Sat, 30 Nov 2013 15:13:26 CST -06:00]]
20862
+  (0.3ms) COMMIT
20863
+ StripeLocal::Customer Load (0.3ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
20864
+ StripeLocal::Subscription Load (0.6ms) SELECT "stripe_local_subscriptions".* FROM "stripe_local_subscriptions" WHERE "stripe_local_subscriptions"."customer_id" = 'cus_123' LIMIT 1
20865
+  (0.1ms) BEGIN
20866
+ SQL (1.0ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20867
+  (0.3ms) COMMIT
20868
+  (0.1ms) BEGIN
20869
+ SQL (0.4ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20870
+  (0.3ms) COMMIT
20871
+  (0.1ms) BEGIN
20872
+ SQL (0.4ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20873
+  (0.3ms) COMMIT
20874
+  (0.1ms) BEGIN
20875
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20876
+  (0.4ms) COMMIT
20877
+  (0.1ms) BEGIN
20878
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20879
+  (0.2ms) COMMIT
20880
+  (0.1ms) BEGIN
20881
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20882
+  (0.3ms) COMMIT
20883
+  (0.3ms) SELECT COUNT(*) FROM "stripe_local_balances"
20884
+ StripeLocal::Balance Load (0.3ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
20885
+ StripeLocal::Balance Load (0.2ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
20886
+ SQL (0.5ms) UPDATE "stripe_local_balances" SET "updated_at" = '2013-12-01 21:13:27.029299' WHERE "stripe_local_balances"."id" = 6
20887
+  (0.1ms) SELECT COUNT(*) FROM "stripe_local_balances"
20888
+ StripeLocal::Balance Load (0.2ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
20889
+  (0.1ms) BEGIN
20890
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20891
+  (0.3ms) COMMIT
20892
+  (0.1ms) BEGIN
20893
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20894
+  (0.2ms) COMMIT
20895
+  (0.2ms) SELECT "stripe_local_balances"."available" FROM "stripe_local_balances"
20896
+  (0.1ms) BEGIN
20897
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20898
+  (0.3ms) COMMIT
20899
+  (0.1ms) BEGIN
20900
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20901
+  (0.2ms) COMMIT
20902
+  (0.1ms) SELECT COUNT(*) FROM "stripe_local_balances"
20903
+  (0.0ms) BEGIN
20904
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 39800], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 0], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20905
+  (0.2ms) COMMIT
20906
+  (0.1ms) SELECT COUNT(*) FROM "stripe_local_balances"
20907
+  (0.1ms) BEGIN
20908
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20909
+  (0.2ms) COMMIT
20910
+  (0.0ms) BEGIN
20911
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20912
+  (0.2ms) COMMIT
20913
+  (0.1ms) SELECT "stripe_local_balances"."pending" FROM "stripe_local_balances"
20914
+  (0.1ms) BEGIN
20915
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20916
+  (0.3ms) COMMIT
20917
+  (0.1ms) BEGIN
20918
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20919
+  (0.2ms) COMMIT
20920
+  (0.2ms) SELECT "stripe_local_balances"."available" FROM "stripe_local_balances"
20921
+  (0.1ms) BEGIN
20922
+ SQL (1.8ms) INSERT INTO "stripe_local_charges" ("amount", "card_id", "created", "created_at", "customer_id", "id", "invoice_id", "paid", "transaction_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["amount", 9900], ["card_id", "cc_1eX7GyRo6wivEf"], ["created", Thu, 01 Aug 2013 18:08:14 CDT -05:00], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["customer_id", "cus_1eX7onie2gq8m1"], ["id", "ch_2wiSyZQkZw8F50"], ["invoice_id", "in_2whTLSkV2ItHAv"], ["paid", true], ["transaction_id", "txn_2wiSFq1N6BTZTQ"], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20923
+  (0.5ms) COMMIT
20924
+  (0.2ms) BEGIN
20925
+ SQL (1.1ms) INSERT INTO "stripe_local_transactions" ("amount", "available_on", "created", "created_at", "description", "fee", "id", "net", "source_id", "source_type", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["amount", -100], ["available_on", Mon, 07 Oct 2013 05:01:01 CDT -05:00], ["created", Mon, 30 Sep 2013 05:01:01 CDT -05:00], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["description", "a dollar for Don Atello"], ["fee", 25], ["id", "txn_2fOGkiBkDgpObU"], ["net", -125], ["source_id", "tr_2fOGfKABdHu3uf"], ["source_type", "transfer"], ["status", "available"], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20926
+  (0.4ms) COMMIT
20927
+ StripeLocal::Plan Load (0.4ms) SELECT "stripe_local_plans".* FROM "stripe_local_plans" WHERE "stripe_local_plans"."id" = 'New_Plan' LIMIT 1
20928
+  (0.2ms) BEGIN
20929
+ SQL (1.4ms) INSERT INTO "stripe_local_plans" ("amount", "created_at", "id", "interval", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["amount", 2999], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["id", "New_Plan"], ["interval", "month"], ["name", "New Plan"], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20930
+  (0.3ms) COMMIT
20931
+  (0.2ms) BEGIN
20932
+ SQL (1.5ms) INSERT INTO "stripe_local_line_items" ("amount", "created_at", "id", "invoice_id", "period_end", "period_start", "plan_id", "proration", "quantity", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["amount", 9900], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["id", "su_1bfTBoL3o7blah"], ["invoice_id", "in_2blahblahagain"], ["period_end", Thu, 06 Jun 2013 18:23:47 CDT -05:00], ["period_start", Tue, 07 May 2013 18:23:47 CDT -05:00], ["plan_id", "HR99"], ["proration", false], ["quantity", 1], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20933
+  (0.2ms) COMMIT
20934
+  (0.1ms) BEGIN
20935
+ SQL (1.1ms) INSERT INTO "stripe_local_invoices" ("amount_due", "attempt_count", "attempted", "charge_id", "closed", "created_at", "customer_id", "date", "discount", "ending_balance", "id", "paid", "period_end", "period_start", "starting_balance", "subtotal", "total", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) RETURNING "id" [["amount_due", 9900], ["attempt_count", 0], ["attempted", true], ["charge_id", "ch_blahblahblah"], ["closed", true], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["customer_id", "cus_1A3zUmx7NpUgrT"], ["date", Tue, 07 May 2013 18:23:47 CDT -05:00], ["discount", nil], ["ending_balance", 0], ["id", "in_2blahblahagain"], ["paid", true], ["period_end", Tue, 07 May 2013 18:23:47 CDT -05:00], ["period_start", Tue, 07 May 2013 18:23:47 CDT -05:00], ["starting_balance", 0], ["subtotal", 9900], ["total", 9900], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20936
+  (0.4ms) COMMIT
20937
+ StripeLocal::LineItem Load (0.7ms) SELECT "stripe_local_line_items".* FROM "stripe_local_line_items" WHERE "stripe_local_line_items"."invoice_id" = $1 [["invoice_id", "in_2blahblahagain"]]
20938
+  (0.2ms) BEGIN
20939
+ SQL (0.6ms) INSERT INTO "stripe_local_subscriptions" ("created_at", "current_period_end", "current_period_start", "customer_id", "plan_id", "start", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["current_period_end", Wed, 11 Dec 2013 15:32:46 CST -06:00], ["current_period_start", Mon, 11 Nov 2013 15:32:46 CST -06:00], ["customer_id", "cus_2vIuZmAfWK89Yk"], ["plan_id", "HR99"], ["start", Mon, 11 Nov 2013 15:32:46 CST -06:00], ["status", "active"], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20940
+  (0.3ms) COMMIT
20941
+  (0.1ms) BEGIN
20942
+ SQL (0.4ms) INSERT INTO "stripe_local_cards" ("brand", "created_at", "customer_id", "cvc_check", "exp_month", "exp_year", "id", "last4", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["brand", "Visa"], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["customer_id", "cus_2J7PZ8ncCbR10Z"], ["cvc_check", "pass"], ["exp_month", 1], ["exp_year", 2014], ["id", "cc_2J7Pscoh4jvFjJ"], ["last4", "4242"], ["name", "Connor Tumbleson"], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20943
+  (0.3ms) COMMIT
20944
+  (0.2ms) BEGIN
20945
+ SQL (1.4ms) INSERT INTO "stripe_local_transfers" ("amount", "created_at", "date", "description", "id", "status", "transaction_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["amount", 100], ["created_at", Sat, 30 Nov 2013 15:13:27 CST -06:00], ["date", Mon, 30 Sep 2013 05:01:01 CDT -05:00], ["description", "a dollar for Don Atello"], ["id", "tr_2fOGfKABdHu3uf"], ["status", "paid"], ["transaction_id", "txn_2fOGkiBkDgpObU"], ["updated_at", Sat, 30 Nov 2013 15:13:27 CST -06:00]]
20946
+  (0.3ms) COMMIT
20947
+  (1.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_discounts" DISABLE TRIGGER ALL;ALTER TABLE "clients" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_customers" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_transfers" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_cards" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_subscriptions" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_invoices" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_plans" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_line_items" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_charges" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_coupons" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_transactions" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_balances" DISABLE TRIGGER ALL
20948
+  (1.1ms) select table_name from information_schema.views where table_schema = 'dummy_test'
20949
+  (24.2ms) TRUNCATE TABLE "stripe_local_discounts", "clients", "stripe_local_customers", "stripe_local_transfers", "stripe_local_cards", "stripe_local_subscriptions", "stripe_local_invoices", "stripe_local_plans", "stripe_local_line_items", "stripe_local_charges", "stripe_local_coupons", "stripe_local_transactions", "stripe_local_balances" RESTART IDENTITY CASCADE;
20950
+  (1.0ms) ALTER TABLE "stripe_local_discounts" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_customers" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_transfers" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_cards" ENABLE TRIGGER ALL;ALTER TABLE "clients" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_subscriptions" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_invoices" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_plans" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_line_items" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_charges" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_coupons" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_transactions" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_balances" ENABLE TRIGGER ALL
20951
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
20952
+  (0.1ms) BEGIN
20953
+ SQL (6.4ms) INSERT INTO "stripe_local_transfers" ("amount", "created_at", "date", "description", "id", "status", "transaction_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["amount", 100], ["created_at", Sat, 30 Nov 2013 15:13:31 CST -06:00], ["date", Mon, 30 Sep 2013 05:01:01 CDT -05:00], ["description", "a dollar for Don Atello"], ["id", "tr_2fOGfKABdHu3uf"], ["status", "paid"], ["transaction_id", "txn_2fOGkiBkDgpObU"], ["updated_at", Sat, 30 Nov 2013 15:13:31 CST -06:00]]
20954
+  (0.3ms) COMMIT
20955
+  (0.1ms) BEGIN
20956
+ SQL (1.0ms) INSERT INTO "stripe_local_line_items" ("amount", "created_at", "id", "invoice_id", "period_end", "period_start", "plan_id", "proration", "quantity", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["amount", 9900], ["created_at", Sat, 30 Nov 2013 15:13:31 CST -06:00], ["id", "su_1bfTBoL3o7blah"], ["invoice_id", "in_2blahblahagain"], ["period_end", Thu, 06 Jun 2013 18:23:47 CDT -05:00], ["period_start", Tue, 07 May 2013 18:23:47 CDT -05:00], ["plan_id", "HR99"], ["proration", false], ["quantity", 1], ["updated_at", Sat, 30 Nov 2013 15:13:31 CST -06:00]]
20957
+  (0.3ms) COMMIT
20958
+  (0.2ms) BEGIN
20959
+ SQL (1.5ms) INSERT INTO "stripe_local_invoices" ("amount_due", "attempt_count", "attempted", "charge_id", "closed", "created_at", "customer_id", "date", "discount", "ending_balance", "id", "paid", "period_end", "period_start", "starting_balance", "subtotal", "total", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) RETURNING "id" [["amount_due", 9900], ["attempt_count", 0], ["attempted", true], ["charge_id", "ch_blahblahblah"], ["closed", true], ["created_at", Sat, 30 Nov 2013 15:13:31 CST -06:00], ["customer_id", "cus_1A3zUmx7NpUgrT"], ["date", Tue, 07 May 2013 18:23:47 CDT -05:00], ["discount", nil], ["ending_balance", 0], ["id", "in_2blahblahagain"], ["paid", true], ["period_end", Tue, 07 May 2013 18:23:47 CDT -05:00], ["period_start", Tue, 07 May 2013 18:23:47 CDT -05:00], ["starting_balance", 0], ["subtotal", 9900], ["total", 9900], ["updated_at", Sat, 30 Nov 2013 15:13:31 CST -06:00]]
20960
+  (0.3ms) COMMIT
20961
+ StripeLocal::LineItem Load (0.6ms) SELECT "stripe_local_line_items".* FROM "stripe_local_line_items" WHERE "stripe_local_line_items"."invoice_id" = $1 [["invoice_id", "in_2blahblahagain"]]
20962
+  (0.2ms) BEGIN
20963
+ SQL (1.4ms) INSERT INTO "stripe_local_transactions" ("amount", "available_on", "created", "created_at", "description", "fee", "id", "net", "source_id", "source_type", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["amount", -100], ["available_on", Mon, 07 Oct 2013 05:01:01 CDT -05:00], ["created", Mon, 30 Sep 2013 05:01:01 CDT -05:00], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["description", "a dollar for Don Atello"], ["fee", 25], ["id", "txn_2fOGkiBkDgpObU"], ["net", -125], ["source_id", "tr_2fOGfKABdHu3uf"], ["source_type", "transfer"], ["status", "available"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20964
+  (0.3ms) COMMIT
20965
+ StripeLocal::Customer Load (0.5ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20966
+  (0.1ms) BEGIN
20967
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20968
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20969
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20970
+ StripeLocal::Customer Load (0.1ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20971
+ StripeLocal::Customer Load (0.1ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20972
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20973
+ StripeLocal::Customer Load (0.1ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20974
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
20975
+ SQL (0.7ms) INSERT INTO "clients" ("created_at", "email", "name", "password", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["email", "test@test.com"], ["name", "Test Case"], ["password", "password"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20976
+  (0.2ms) COMMIT
20977
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
20978
+  (0.1ms) BEGIN
20979
+ SQL (1.0ms) INSERT INTO "stripe_local_cards" ("brand", "created_at", "customer_id", "cvc_check", "exp_month", "exp_year", "id", "last4", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["brand", "Visa"], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["customer_id", "cus_123"], ["cvc_check", "pass"], ["exp_month", 8], ["exp_year", 2014], ["id", "card_102Y2J1Cmf55uWiejglofO7j"], ["last4", "4242"], ["name", "Test Case"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20980
+  (0.3ms) COMMIT
20981
+  (0.2ms) BEGIN
20982
+ SQL (1.1ms) INSERT INTO "stripe_local_subscriptions" ("created_at", "current_period_end", "current_period_start", "customer_id", "plan_id", "start", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["current_period_end", Thu, 10 Oct 2013 13:52:04 CDT -05:00], ["current_period_start", Tue, 10 Sep 2013 13:52:04 CDT -05:00], ["customer_id", "cus_123"], ["plan_id", "GIN100"], ["start", Tue, 10 Sep 2013 13:52:04 CDT -05:00], ["status", "active"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20983
+  (0.4ms) COMMIT
20984
+  (0.1ms) BEGIN
20985
+ SQL (0.8ms) INSERT INTO "stripe_local_customers" ("account_balance", "created_at", "default_card", "delinquent", "description", "email", "id", "model_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["account_balance", 0], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["default_card", "card_102Y2J1Cmf55uWiejglofO7j"], ["delinquent", false], ["description", "On September 10th, Test signed up for CA50."], ["email", "test@test.com"], ["id", "cus_123"], ["model_id", 1], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20986
+  (0.3ms) COMMIT
20987
+ StripeLocal::Customer Load (0.3ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
20988
+ StripeLocal::Subscription Load (0.3ms) SELECT "stripe_local_subscriptions".* FROM "stripe_local_subscriptions" WHERE "stripe_local_subscriptions"."customer_id" = 'cus_123' LIMIT 1
20989
+  (0.1ms) BEGIN
20990
+ SQL (0.6ms) INSERT INTO "stripe_local_subscriptions" ("created_at", "current_period_end", "current_period_start", "customer_id", "plan_id", "start", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["current_period_end", Wed, 11 Dec 2013 15:32:46 CST -06:00], ["current_period_start", Mon, 11 Nov 2013 15:32:46 CST -06:00], ["customer_id", "cus_2vIuZmAfWK89Yk"], ["plan_id", "HR99"], ["start", Mon, 11 Nov 2013 15:32:46 CST -06:00], ["status", "active"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20991
+  (0.3ms) COMMIT
20992
+  (0.1ms) BEGIN
20993
+ SQL (0.4ms) INSERT INTO "stripe_local_cards" ("brand", "created_at", "customer_id", "cvc_check", "exp_month", "exp_year", "id", "last4", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["brand", "Visa"], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["customer_id", "cus_2J7PZ8ncCbR10Z"], ["cvc_check", "pass"], ["exp_month", 1], ["exp_year", 2014], ["id", "cc_2J7Pscoh4jvFjJ"], ["last4", "4242"], ["name", "Connor Tumbleson"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20994
+  (0.3ms) COMMIT
20995
+  (0.2ms) BEGIN
20996
+ SQL (1.2ms) INSERT INTO "stripe_local_charges" ("amount", "card_id", "created", "created_at", "customer_id", "id", "invoice_id", "paid", "transaction_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["amount", 9900], ["card_id", "cc_1eX7GyRo6wivEf"], ["created", Thu, 01 Aug 2013 18:08:14 CDT -05:00], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["customer_id", "cus_1eX7onie2gq8m1"], ["id", "ch_2wiSyZQkZw8F50"], ["invoice_id", "in_2whTLSkV2ItHAv"], ["paid", true], ["transaction_id", "txn_2wiSFq1N6BTZTQ"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
20997
+  (0.4ms) COMMIT
20998
+  (0.1ms) BEGIN
20999
+ SQL (0.7ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21000
+  (0.3ms) COMMIT
21001
+  (0.1ms) BEGIN
21002
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21003
+  (0.3ms) COMMIT
21004
+  (0.2ms) SELECT COUNT(*) FROM "stripe_local_balances"
21005
+  (0.1ms) BEGIN
21006
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 39800], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 0], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21007
+  (0.2ms) COMMIT
21008
+  (0.1ms) SELECT COUNT(*) FROM "stripe_local_balances"
21009
+  (0.1ms) BEGIN
21010
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21011
+  (0.4ms) COMMIT
21012
+  (0.1ms) BEGIN
21013
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21014
+  (0.2ms) COMMIT
21015
+  (0.1ms) SELECT COUNT(*) FROM "stripe_local_balances"
21016
+ StripeLocal::Balance Load (0.3ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
21017
+ StripeLocal::Balance Load (0.2ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
21018
+ SQL (0.4ms) UPDATE "stripe_local_balances" SET "updated_at" = '2013-12-01 21:13:32.294086' WHERE "stripe_local_balances"."id" = 5
21019
+  (0.2ms) SELECT COUNT(*) FROM "stripe_local_balances"
21020
+ StripeLocal::Balance Load (0.2ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
21021
+  (0.1ms) BEGIN
21022
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21023
+  (0.4ms) COMMIT
21024
+  (0.1ms) BEGIN
21025
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21026
+  (0.2ms) COMMIT
21027
+  (0.1ms) SELECT "stripe_local_balances"."pending" FROM "stripe_local_balances"
21028
+  (0.1ms) BEGIN
21029
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21030
+  (0.2ms) COMMIT
21031
+  (0.1ms) BEGIN
21032
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21033
+  (0.3ms) COMMIT
21034
+  (0.1ms) SELECT "stripe_local_balances"."available" FROM "stripe_local_balances"
21035
+  (0.1ms) BEGIN
21036
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21037
+  (0.3ms) COMMIT
21038
+  (0.1ms) BEGIN
21039
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21040
+  (0.2ms) COMMIT
21041
+  (0.1ms) SELECT "stripe_local_balances"."available" FROM "stripe_local_balances"
21042
+  (0.1ms) BEGIN
21043
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21044
+  (0.2ms) COMMIT
21045
+  (0.0ms) BEGIN
21046
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21047
+  (0.2ms) COMMIT
21048
+  (0.1ms) BEGIN
21049
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21050
+  (0.2ms) COMMIT
21051
+  (0.0ms) BEGIN
21052
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21053
+  (0.2ms) COMMIT
21054
+ StripeLocal::Plan Load (0.3ms) SELECT "stripe_local_plans".* FROM "stripe_local_plans" WHERE "stripe_local_plans"."id" = 'New_Plan' LIMIT 1
21055
+  (0.1ms) BEGIN
21056
+ SQL (0.8ms) INSERT INTO "stripe_local_plans" ("amount", "created_at", "id", "interval", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["amount", 2999], ["created_at", Sat, 30 Nov 2013 15:13:32 CST -06:00], ["id", "New_Plan"], ["interval", "month"], ["name", "New Plan"], ["updated_at", Sat, 30 Nov 2013 15:13:32 CST -06:00]]
21057
+  (0.3ms) COMMIT
21058
+  (1.4ms) ALTER TABLE "stripe_local_discounts" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_customers" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_transfers" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_cards" DISABLE TRIGGER ALL;ALTER TABLE "clients" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_subscriptions" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_invoices" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_plans" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_line_items" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_charges" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_coupons" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_transactions" DISABLE TRIGGER ALL;ALTER TABLE "stripe_local_balances" DISABLE TRIGGER ALL
21059
+  (1.3ms) select table_name from information_schema.views where table_schema = 'dummy_test'
21060
+  (41.8ms) TRUNCATE TABLE "stripe_local_discounts", "stripe_local_customers", "stripe_local_transfers", "stripe_local_cards", "clients", "stripe_local_subscriptions", "stripe_local_invoices", "stripe_local_plans", "stripe_local_line_items", "stripe_local_charges", "stripe_local_coupons", "stripe_local_transactions", "stripe_local_balances" RESTART IDENTITY CASCADE;
21061
+  (0.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_discounts" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_transfers" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_cards" ENABLE TRIGGER ALL;ALTER TABLE "clients" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_customers" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_subscriptions" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_invoices" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_plans" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_line_items" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_charges" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_coupons" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_transactions" ENABLE TRIGGER ALL;ALTER TABLE "stripe_local_balances" ENABLE TRIGGER ALL
21062
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
21063
+ StripeLocal::Customer Load (0.5ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21064
+  (0.1ms) BEGIN
21065
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21066
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21067
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21068
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21069
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21070
+ StripeLocal::Customer Load (0.4ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21071
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21072
+ StripeLocal::Customer Load (0.2ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" IS NULL LIMIT 1
21073
+ SQL (4.2ms) INSERT INTO "clients" ("created_at", "email", "name", "password", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["email", "test@test.com"], ["name", "Test Case"], ["password", "password"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21074
+  (0.3ms) COMMIT
21075
+ StripeLocal::Customer Load (0.3ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
21076
+  (0.1ms) BEGIN
21077
+ SQL (0.9ms) INSERT INTO "stripe_local_cards" ("brand", "created_at", "customer_id", "cvc_check", "exp_month", "exp_year", "id", "last4", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["brand", "Visa"], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["customer_id", "cus_123"], ["cvc_check", "pass"], ["exp_month", 8], ["exp_year", 2014], ["id", "card_102Y2J1Cmf55uWiejglofO7j"], ["last4", "4242"], ["name", "Test Case"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21078
+  (0.3ms) COMMIT
21079
+  (0.1ms) BEGIN
21080
+ SQL (1.2ms) INSERT INTO "stripe_local_subscriptions" ("created_at", "current_period_end", "current_period_start", "customer_id", "plan_id", "start", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["current_period_end", Thu, 10 Oct 2013 13:52:04 CDT -05:00], ["current_period_start", Tue, 10 Sep 2013 13:52:04 CDT -05:00], ["customer_id", "cus_123"], ["plan_id", "GIN100"], ["start", Tue, 10 Sep 2013 13:52:04 CDT -05:00], ["status", "active"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21081
+  (0.3ms) COMMIT
21082
+  (0.1ms) BEGIN
21083
+ SQL (0.8ms) INSERT INTO "stripe_local_customers" ("account_balance", "created_at", "default_card", "delinquent", "description", "email", "id", "model_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["account_balance", 0], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["default_card", "card_102Y2J1Cmf55uWiejglofO7j"], ["delinquent", false], ["description", "On September 10th, Test signed up for CA50."], ["email", "test@test.com"], ["id", "cus_123"], ["model_id", 1], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21084
+  (0.3ms) COMMIT
21085
+ StripeLocal::Customer Load (0.4ms) SELECT "stripe_local_customers".* FROM "stripe_local_customers" WHERE "stripe_local_customers"."model_id" = 1 LIMIT 1
21086
+ StripeLocal::Subscription Load (0.5ms) SELECT "stripe_local_subscriptions".* FROM "stripe_local_subscriptions" WHERE "stripe_local_subscriptions"."customer_id" = 'cus_123' LIMIT 1
21087
+ StripeLocal::Plan Load (0.4ms) SELECT "stripe_local_plans".* FROM "stripe_local_plans" WHERE "stripe_local_plans"."id" = 'New_Plan' LIMIT 1
21088
+  (0.1ms) BEGIN
21089
+ SQL (0.7ms) INSERT INTO "stripe_local_plans" ("amount", "created_at", "id", "interval", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["amount", 2999], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["id", "New_Plan"], ["interval", "month"], ["name", "New Plan"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21090
+  (0.2ms) COMMIT
21091
+  (0.2ms) BEGIN
21092
+ SQL (1.7ms) INSERT INTO "stripe_local_charges" ("amount", "card_id", "created", "created_at", "customer_id", "id", "invoice_id", "paid", "transaction_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["amount", 9900], ["card_id", "cc_1eX7GyRo6wivEf"], ["created", Thu, 01 Aug 2013 18:08:14 CDT -05:00], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["customer_id", "cus_1eX7onie2gq8m1"], ["id", "ch_2wiSyZQkZw8F50"], ["invoice_id", "in_2whTLSkV2ItHAv"], ["paid", true], ["transaction_id", "txn_2wiSFq1N6BTZTQ"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21093
+  (0.3ms) COMMIT
21094
+  (0.2ms) BEGIN
21095
+ SQL (0.9ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21096
+  (0.3ms) COMMIT
21097
+  (0.1ms) BEGIN
21098
+ SQL (0.5ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21099
+  (0.3ms) COMMIT
21100
+  (0.2ms) SELECT "stripe_local_balances"."pending" FROM "stripe_local_balances"
21101
+  (0.1ms) BEGIN
21102
+ SQL (0.4ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21103
+  (0.3ms) COMMIT
21104
+  (0.1ms) BEGIN
21105
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21106
+  (0.3ms) COMMIT
21107
+  (0.2ms) SELECT COUNT(*) FROM "stripe_local_balances"
21108
+  (0.1ms) BEGIN
21109
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 39800], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 0], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21110
+  (0.3ms) COMMIT
21111
+  (0.2ms) SELECT COUNT(*) FROM "stripe_local_balances"
21112
+  (0.1ms) BEGIN
21113
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21114
+  (0.3ms) COMMIT
21115
+  (0.1ms) BEGIN
21116
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21117
+  (0.3ms) COMMIT
21118
+  (0.1ms) BEGIN
21119
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21120
+  (0.3ms) COMMIT
21121
+  (0.1ms) BEGIN
21122
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21123
+  (0.3ms) COMMIT
21124
+  (0.1ms) BEGIN
21125
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21126
+  (0.2ms) COMMIT
21127
+  (0.0ms) BEGIN
21128
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21129
+  (0.2ms) COMMIT
21130
+  (0.1ms) SELECT "stripe_local_balances"."available" FROM "stripe_local_balances"
21131
+  (0.1ms) BEGIN
21132
+ SQL (0.3ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21133
+  (0.2ms) COMMIT
21134
+  (0.0ms) BEGIN
21135
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21136
+  (0.2ms) COMMIT
21137
+  (0.1ms) SELECT COUNT(*) FROM "stripe_local_balances"
21138
+ StripeLocal::Balance Load (0.3ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
21139
+ StripeLocal::Balance Load (0.2ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
21140
+ SQL (0.4ms) UPDATE "stripe_local_balances" SET "updated_at" = '2013-12-01 21:17:41.767251' WHERE "stripe_local_balances"."id" = 13
21141
+  (0.2ms) SELECT COUNT(*) FROM "stripe_local_balances"
21142
+ StripeLocal::Balance Load (0.2ms) SELECT "stripe_local_balances".* FROM "stripe_local_balances" ORDER BY "stripe_local_balances"."id" DESC LIMIT 1
21143
+  (0.1ms) BEGIN
21144
+ SQL (0.4ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 29900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21145
+  (0.3ms) COMMIT
21146
+  (0.1ms) BEGIN
21147
+ SQL (0.2ms) INSERT INTO "stripe_local_balances" ("available", "created_at", "pending", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["available", 19900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["pending", 19900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21148
+  (0.2ms) COMMIT
21149
+  (0.1ms) SELECT "stripe_local_balances"."available" FROM "stripe_local_balances"
21150
+  (0.1ms) BEGIN
21151
+ SQL (0.4ms) INSERT INTO "stripe_local_cards" ("brand", "created_at", "customer_id", "cvc_check", "exp_month", "exp_year", "id", "last4", "name", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["brand", "Visa"], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["customer_id", "cus_2J7PZ8ncCbR10Z"], ["cvc_check", "pass"], ["exp_month", 1], ["exp_year", 2014], ["id", "cc_2J7Pscoh4jvFjJ"], ["last4", "4242"], ["name", "Connor Tumbleson"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21152
+  (0.3ms) COMMIT
21153
+  (0.2ms) BEGIN
21154
+ SQL (1.3ms) INSERT INTO "stripe_local_line_items" ("amount", "created_at", "id", "invoice_id", "period_end", "period_start", "plan_id", "proration", "quantity", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["amount", 9900], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["id", "su_1bfTBoL3o7blah"], ["invoice_id", "in_2blahblahagain"], ["period_end", Thu, 06 Jun 2013 18:23:47 CDT -05:00], ["period_start", Tue, 07 May 2013 18:23:47 CDT -05:00], ["plan_id", "HR99"], ["proration", false], ["quantity", 1], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21155
+  (0.3ms) COMMIT
21156
+  (0.1ms) BEGIN
21157
+ SQL (1.1ms) INSERT INTO "stripe_local_invoices" ("amount_due", "attempt_count", "attempted", "charge_id", "closed", "created_at", "customer_id", "date", "discount", "ending_balance", "id", "paid", "period_end", "period_start", "starting_balance", "subtotal", "total", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) RETURNING "id" [["amount_due", 9900], ["attempt_count", 0], ["attempted", true], ["charge_id", "ch_blahblahblah"], ["closed", true], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["customer_id", "cus_1A3zUmx7NpUgrT"], ["date", Tue, 07 May 2013 18:23:47 CDT -05:00], ["discount", nil], ["ending_balance", 0], ["id", "in_2blahblahagain"], ["paid", true], ["period_end", Tue, 07 May 2013 18:23:47 CDT -05:00], ["period_start", Tue, 07 May 2013 18:23:47 CDT -05:00], ["starting_balance", 0], ["subtotal", 9900], ["total", 9900], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21158
+  (0.3ms) COMMIT
21159
+ StripeLocal::LineItem Load (0.7ms) SELECT "stripe_local_line_items".* FROM "stripe_local_line_items" WHERE "stripe_local_line_items"."invoice_id" = $1 [["invoice_id", "in_2blahblahagain"]]
21160
+  (0.1ms) BEGIN
21161
+ SQL (0.7ms) INSERT INTO "stripe_local_subscriptions" ("created_at", "current_period_end", "current_period_start", "customer_id", "plan_id", "start", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["current_period_end", Wed, 11 Dec 2013 15:32:46 CST -06:00], ["current_period_start", Mon, 11 Nov 2013 15:32:46 CST -06:00], ["customer_id", "cus_2vIuZmAfWK89Yk"], ["plan_id", "HR99"], ["start", Mon, 11 Nov 2013 15:32:46 CST -06:00], ["status", "active"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21162
+  (0.5ms) COMMIT
21163
+  (0.1ms) BEGIN
21164
+ SQL (1.0ms) INSERT INTO "stripe_local_transactions" ("amount", "available_on", "created", "created_at", "description", "fee", "id", "net", "source_id", "source_type", "status", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["amount", -100], ["available_on", Mon, 07 Oct 2013 05:01:01 CDT -05:00], ["created", Mon, 30 Sep 2013 05:01:01 CDT -05:00], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["description", "a dollar for Don Atello"], ["fee", 25], ["id", "txn_2fOGkiBkDgpObU"], ["net", -125], ["source_id", "tr_2fOGfKABdHu3uf"], ["source_type", "transfer"], ["status", "available"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21165
+  (0.4ms) COMMIT
21166
+  (0.1ms) BEGIN
21167
+ SQL (1.0ms) INSERT INTO "stripe_local_transfers" ("amount", "created_at", "date", "description", "id", "status", "transaction_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["amount", 100], ["created_at", Sat, 30 Nov 2013 15:17:41 CST -06:00], ["date", Mon, 30 Sep 2013 05:01:01 CDT -05:00], ["description", "a dollar for Don Atello"], ["id", "tr_2fOGfKABdHu3uf"], ["status", "paid"], ["transaction_id", "txn_2fOGkiBkDgpObU"], ["updated_at", Sat, 30 Nov 2013 15:17:41 CST -06:00]]
21168
+  (0.3ms) COMMIT
@@ -11,15 +11,15 @@ describe StripeLocal::Customer do
11
11
  stripe_customer.should_receive :update_subscription
12
12
  StripeLocal::Customer.should_receive( :create ).and_call_original
13
13
  StripeLocal::Customer.should_receive( :normalize ).and_call_original
14
- client.signup( {card: "token", plan: "plan"} )
14
+ client.signup( {card: "token", plan: "GIN100"} )
15
15
 
16
16
  client.customer.id.should eq "cus_123"
17
17
 
18
18
  client.subscription.plan_id.should eq "GIN100"
19
19
  end
20
20
 
21
- it "refers to StripeLocal mattr_accessor for application level model_class" do
22
- StripeLocal::model_class.new.should be_a Client
21
+ it "derives its model association via the StripeLocal method :model_class" do
22
+ StripeLocal.model_class.new.should be_a Client
23
23
  end
24
24
 
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe_local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Cohen
@@ -213,7 +213,9 @@ files:
213
213
  - app/views/layouts/stripe_local/application.html.erb
214
214
  - config/routes.rb
215
215
  - db/migrate/20131122063517_load_stripe_tables.rb
216
+ - lib/stripe_local/association_methods.rb
216
217
  - lib/stripe_local/engine.rb
218
+ - lib/stripe_local/instance_delegation.rb
217
219
  - lib/stripe_local/version.rb
218
220
  - lib/stripe_local/webhook/subscriber.rb
219
221
  - lib/stripe_local/webhook/types.rb