koudoku 0.0.11 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +56 -17
  3. data/Rakefile +1 -32
  4. data/app/concerns/koudoku/plan.rb +0 -8
  5. data/app/concerns/koudoku/subscription.rb +36 -20
  6. data/app/controllers/koudoku/subscriptions_controller.rb +45 -11
  7. data/app/views/koudoku/subscriptions/_card.html.erb +1 -1
  8. data/app/views/koudoku/subscriptions/show.html.erb +6 -6
  9. data/config/initializers/stripe_event.rb +27 -0
  10. data/config/routes.rb +3 -1
  11. data/lib/generators/koudoku/install_generator.rb +27 -31
  12. data/lib/generators/koudoku/templates/app/models/coupon.rb +5 -0
  13. data/lib/generators/koudoku/templates/app/models/plan.rb +6 -0
  14. data/lib/generators/koudoku/templates/app/models/subscription.rb +8 -0
  15. data/lib/generators/koudoku/templates/config/initializers/koudoku.rb +13 -0
  16. data/lib/generators/koudoku/views_generator.rb +5 -2
  17. data/lib/koudoku/version.rb +1 -1
  18. data/lib/koudoku.rb +28 -10
  19. data/spec/concerns/koudoku/plan_spec.rb +13 -13
  20. data/spec/dummy/app/models/plan.rb +0 -1
  21. data/spec/dummy/config/application.rb +0 -6
  22. data/spec/dummy/config/environments/development.rb +2 -7
  23. data/spec/dummy/config/environments/production.rb +2 -0
  24. data/spec/dummy/config/environments/test.rb +2 -3
  25. data/spec/dummy/config/initializers/koudoku.rb +1 -1
  26. data/spec/dummy/db/development.sqlite3 +0 -0
  27. data/spec/dummy/db/test.sqlite3 +0 -0
  28. data/spec/dummy/log/development.log +48 -0
  29. data/spec/dummy/log/test.log +203 -0
  30. metadata +60 -48
  31. data/app/controllers/koudoku/webhooks_controller.rb +0 -39
  32. data/spec/controllers/koudoku/webhooks_controller_spec.rb +0 -76
  33. data/spec/dummy/spec/factories/coupons.rb +0 -8
  34. data/spec/dummy/spec/factories/plans.rb +0 -12
  35. data/spec/dummy/spec/factories/subscriptions.rb +0 -14
  36. data/spec/dummy/spec/models/coupon_spec.rb +0 -5
  37. data/spec/dummy/spec/models/plan_spec.rb +0 -5
  38. data/spec/dummy/spec/models/subscription_spec.rb +0 -5
@@ -0,0 +1,13 @@
1
+ Koudoku.setup do |config|
2
+ config.subscriptions_owned_by = :<%= subscription_owner_model %>
3
+ config.stripe_publishable_key = ENV['STRIPE_PUBLISHABLE_KEY']
4
+ config.stripe_secret_key = ENV['STRIPE_SECRET_KEY']
5
+ # config.prorate = false # Default is true, set to false to disable prorating subscriptions
6
+ # config.free_trial_length = 30
7
+
8
+ # you can subscribe to additional webhooks here
9
+ # we use stripe_event under the hood and you can subscribe using the
10
+ # stripe_event syntax on the config object:
11
+ # config.subscribe 'charge.failed', Koudoku::ChargeFailed
12
+
13
+ end
@@ -10,7 +10,7 @@ module Koudoku
10
10
  class ViewsGenerator < Rails::Generators::Base
11
11
 
12
12
  # Not sure what this does.
13
- source_root File.expand_path("../../../../app/views/koudoku/subscriptions", __FILE__)
13
+ source_root "#{Koudoku::Engine.root}/app/views/koudoku/subscriptions"
14
14
 
15
15
  include Rails::Generators::Migration
16
16
 
@@ -18,7 +18,10 @@ module Koudoku
18
18
 
19
19
  def install
20
20
 
21
- ["_card.html.erb","_pricing_table.html.erb", "edit.html.erb", "index.html.erb", "new.html.erb", "show.html.erb", "unauthorized.html.erb"].each do |file|
21
+ # all entries in app/views/koudoku/subscriptions without . and ..
22
+ # ==> all FILES in the directory
23
+ files_to_copy = Dir.entries("#{Koudoku::Engine.root}/app/views/koudoku/subscriptions") - %w[. ..]
24
+ files_to_copy.each do |file|
22
25
  copy_file file, "app/views/koudoku/subscriptions/#{file}"
23
26
  end
24
27
 
@@ -1,3 +1,3 @@
1
1
  module Koudoku
2
- VERSION = "0.0.11"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/koudoku.rb CHANGED
@@ -1,12 +1,9 @@
1
1
  require "koudoku/engine"
2
2
  require "generators/koudoku/install_generator"
3
3
  require "generators/koudoku/views_generator"
4
+ require 'stripe_event'
4
5
 
5
6
  module Koudoku
6
-
7
- mattr_accessor :webhooks_api_key
8
- @@webhooks_api_key = nil
9
-
10
7
  mattr_accessor :subscriptions_owned_by
11
8
  @@subscriptions_owned_by = nil
12
9
 
@@ -18,6 +15,13 @@ module Koudoku
18
15
 
19
16
  mattr_accessor :free_trial_length
20
17
  @@free_trial_length = nil
18
+
19
+ mattr_accessor :prorate
20
+ @@prorate = true
21
+
22
+ def self.webhooks_api_key=(key)
23
+ raise "Koudoku no longer uses an API key to secure webhooks, please delete the line from \"config/initializers/koudoku.rb\""
24
+ end
21
25
 
22
26
  def self.setup
23
27
  yield self
@@ -33,18 +37,16 @@ module Koudoku
33
37
 
34
38
  # e.g. :user_id
35
39
  def self.owner_id_sym
36
- # e.g. :user_id
37
- (Koudoku.subscriptions_owned_by.to_s + '_id').to_sym
40
+ :"#{Koudoku.subscriptions_owned_by}_id"
38
41
  end
39
42
 
43
+ # e.g. :user=
40
44
  def self.owner_assignment_sym
41
- # e.g. :user=
42
- (Koudoku.subscriptions_owned_by.to_s + '=').to_sym
45
+ :"#{Koudoku.subscriptions_owned_by}="
43
46
  end
44
47
 
45
- # e.g. Users
48
+ # e.g. User
46
49
  def self.owner_class
47
- # e.g. User
48
50
  Koudoku.subscriptions_owned_by.to_s.classify.constantize
49
51
  end
50
52
 
@@ -52,4 +54,20 @@ module Koudoku
52
54
  free_trial_length.to_i > 0
53
55
  end
54
56
 
57
+
58
+ #
59
+ # STRIPE_EVENT section
60
+ #
61
+ def self.subscribe(name, callable = Proc.new)
62
+ StripeEvent.subscribe(name, callable)
63
+ end
64
+
65
+ def self.instrument(name, object)
66
+ StripeEvent.backend.instrument(StripeEvent.namespace.call(name), object)
67
+ end
68
+
69
+ def self.all(callable = Proc.new)
70
+ StripeEvent.all(callable)
71
+ end
72
+
55
73
  end
@@ -2,35 +2,35 @@ require 'spec_helper'
2
2
 
3
3
  describe Koudoku::Plan do
4
4
  describe '#is_upgrade_from?' do
5
- before do
6
- class Plan
7
- attr_accessor :price
8
- include Koudoku::Plan
9
- end
10
- end
5
+
6
+ class FakePlan
7
+ attr_accessor :price
8
+ include Koudoku::Plan
9
+ end
10
+
11
11
  it 'returns true if the price is higher' do
12
- plan = Plan.new
12
+ plan = FakePlan.new
13
13
  plan.price = 123.23
14
- cheaper_plan = Plan.new
14
+ cheaper_plan = FakePlan.new
15
15
  cheaper_plan.price = 61.61
16
16
  plan.is_upgrade_from?(cheaper_plan).should be_true
17
17
  end
18
18
  it 'returns true if the price is the same' do
19
- plan = Plan.new
19
+ plan = FakePlan.new
20
20
  plan.price = 123.23
21
21
  plan.is_upgrade_from?(plan).should be_true
22
22
  end
23
23
  it 'returns false if the price is the same or higher' do
24
- plan = Plan.new
24
+ plan = FakePlan.new
25
25
  plan.price = 61.61
26
- more_expensive_plan = Plan.new
26
+ more_expensive_plan = FakePlan.new
27
27
  more_expensive_plan.price = 123.23
28
28
  plan.is_upgrade_from?(more_expensive_plan).should be_false
29
29
  end
30
30
  it 'handles a nil value gracefully' do
31
- plan = Plan.new
31
+ plan = FakePlan.new
32
32
  plan.price = 123.23
33
- cheaper_plan = Plan.new
33
+ cheaper_plan = FakePlan.new
34
34
  lambda {
35
35
  plan.is_upgrade_from?(cheaper_plan).should be_true
36
36
  }.should_not raise_error
@@ -1,5 +1,4 @@
1
1
  class Plan < ActiveRecord::Base
2
- has_many :subscriptions
3
2
 
4
3
  include Koudoku::Plan
5
4
  belongs_to :customer
@@ -45,12 +45,6 @@ module Dummy
45
45
  # like if you have constraints or database-specific column types
46
46
  # config.active_record.schema_format = :sql
47
47
 
48
- # Enforce whitelist mode for mass assignment.
49
- # This will create an empty whitelist of attributes available for mass-assignment for all models
50
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
51
- # parameters by using an attr_accessible or attr_protected declaration.
52
- config.active_record.whitelist_attributes = true
53
-
54
48
  # Enable the asset pipeline
55
49
  config.assets.enabled = true
56
50
 
@@ -22,16 +22,11 @@ Dummy::Application.configure do
22
22
  # Only use best-standards-support built into browsers
23
23
  config.action_dispatch.best_standards_support = :builtin
24
24
 
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
27
-
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
31
-
32
25
  # Do not compress assets
33
26
  config.assets.compress = false
34
27
 
35
28
  # Expands the lines which load the assets
36
29
  config.assets.debug = true
30
+
31
+ config.eager_load = false
37
32
  end
@@ -64,4 +64,6 @@ Dummy::Application.configure do
64
64
  # Log the query plan for queries taking more than this (works
65
65
  # with SQLite, MySQL, and PostgreSQL)
66
66
  # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+
68
+ config.eager_load = true
67
69
  end
@@ -29,9 +29,8 @@ Dummy::Application.configure do
29
29
  # ActionMailer::Base.deliveries array.
30
30
  config.action_mailer.delivery_method = :test
31
31
 
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
32
  # Print deprecation notices to the stderr
36
33
  config.active_support.deprecation = :stderr
34
+
35
+ config.eager_load = false
37
36
  end
@@ -1,5 +1,5 @@
1
1
  Koudoku.setup do |config|
2
- config.webhooks_api_key = "2f1a9b40-abe4-4bbc-86c8-8e7bd000c8b3"
2
+ #config.webhooks_api_key = "2f1a9b40-abe4-4bbc-86c8-8e7bd000c8b3"
3
3
  config.subscriptions_owned_by = :customer
4
4
  config.stripe_publishable_key = 'not_stripe_publishable_key'
5
5
  config.stripe_secret_key = 'not_stripe_secret_key'
Binary file
Binary file
@@ -0,0 +1,48 @@
1
+ Connecting to database specified by database.yml
2
+  (0.4ms) select sqlite_version(*)
3
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
4
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
6
+ Connecting to database specified by database.yml
7
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
8
+ Migrating to CreateCustomers (20130318201927)
9
+  (0.0ms) select sqlite_version(*)
10
+  (0.0ms) begin transaction
11
+  (0.3ms) CREATE TABLE "customers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
12
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130318201927')
13
+  (1.4ms) commit transaction
14
+ Migrating to CreateSubscriptions (20130318204455)
15
+  (0.0ms) begin transaction
16
+  (0.2ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar(255), "plan_id" integer, "last_four" varchar(255), "coupon_id" integer, "card_type" varchar(255), "current_price" float, "customer_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
17
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130318204455')
18
+  (0.6ms) commit transaction
19
+ Migrating to CreatePlans (20130318204458)
20
+  (0.0ms) begin transaction
21
+  (0.2ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "stripe_id" varchar(255), "price" float, "features" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
22
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130318204458')
23
+  (0.6ms) commit transaction
24
+ Migrating to CreateCoupons (20130318204502)
25
+  (0.0ms) begin transaction
26
+  (0.2ms) CREATE TABLE "coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "free_trial_length" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
27
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130318204502')
28
+  (0.6ms) commit transaction
29
+ Migrating to AddIntervalToPlan (20130520163946)
30
+  (0.0ms) begin transaction
31
+  (0.2ms) ALTER TABLE "plans" ADD "interval" varchar(255)
32
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130520163946')
33
+  (0.6ms) commit transaction
34
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
35
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
36
+  (0.2ms) select sqlite_version(*)
37
+  (0.7ms) CREATE TABLE "coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "free_trial_length" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
38
+  (0.6ms) CREATE TABLE "customers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
39
+  (0.8ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "stripe_id" varchar(255), "price" float, "features" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "interval" varchar(255))
40
+  (0.7ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar(255), "plan_id" integer, "last_four" varchar(255), "coupon_id" integer, "card_type" varchar(255), "current_price" float, "customer_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
41
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
42
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
43
+  (0.0ms) SELECT version FROM "schema_migrations"
44
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130520163946')
45
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130318201927')
46
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20130318204455')
47
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20130318204458')
48
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130318204502')
@@ -0,0 +1,203 @@
1
+ Connecting to database specified by database.yml
2
+  (0.2ms) begin transaction
3
+  (0.0ms) rollback transaction
4
+  (0.0ms) begin transaction
5
+  (0.0ms) rollback transaction
6
+  (0.0ms) begin transaction
7
+  (0.0ms) rollback transaction
8
+  (0.0ms) begin transaction
9
+  (0.0ms) rollback transaction
10
+  (0.0ms) begin transaction
11
+  (0.0ms) rollback transaction
12
+  (0.0ms) begin transaction
13
+  (0.0ms) rollback transaction
14
+  (0.0ms) begin transaction
15
+  (0.0ms) rollback transaction
16
+  (0.0ms) begin transaction
17
+  (0.0ms) rollback transaction
18
+  (0.0ms) begin transaction
19
+  (0.0ms) rollback transaction
20
+  (0.0ms) begin transaction
21
+  (0.0ms) rollback transaction
22
+  (0.0ms) begin transaction
23
+  (0.0ms) rollback transaction
24
+  (0.0ms) begin transaction
25
+  (0.0ms) rollback transaction
26
+  (0.0ms) begin transaction
27
+  (0.0ms) rollback transaction
28
+  (0.0ms) begin transaction
29
+  (0.0ms) rollback transaction
30
+  (0.0ms) begin transaction
31
+  (0.0ms) rollback transaction
32
+  (0.0ms) begin transaction
33
+  (0.0ms) rollback transaction
34
+  (0.0ms) begin transaction
35
+  (0.0ms) rollback transaction
36
+  (0.0ms) begin transaction
37
+  (0.0ms) rollback transaction
38
+  (0.0ms) begin transaction
39
+  (0.0ms) rollback transaction
40
+ Connecting to database specified by database.yml
41
+ Connecting to database specified by database.yml
42
+  (0.2ms) begin transaction
43
+  (0.0ms) rollback transaction
44
+  (0.0ms) begin transaction
45
+  (0.0ms) rollback transaction
46
+  (0.0ms) begin transaction
47
+  (0.1ms) rollback transaction
48
+  (0.0ms) begin transaction
49
+  (0.0ms) rollback transaction
50
+  (0.0ms) begin transaction
51
+  (0.0ms) rollback transaction
52
+  (0.0ms) begin transaction
53
+  (0.0ms) rollback transaction
54
+  (0.0ms) begin transaction
55
+  (0.0ms) rollback transaction
56
+  (0.0ms) begin transaction
57
+  (0.0ms) rollback transaction
58
+  (0.0ms) begin transaction
59
+  (0.0ms) rollback transaction
60
+  (0.0ms) begin transaction
61
+  (0.0ms) rollback transaction
62
+  (0.0ms) begin transaction
63
+  (0.0ms) rollback transaction
64
+  (0.0ms) begin transaction
65
+  (0.0ms) rollback transaction
66
+  (0.0ms) begin transaction
67
+  (0.0ms) rollback transaction
68
+  (0.0ms) begin transaction
69
+  (0.0ms) rollback transaction
70
+  (0.0ms) begin transaction
71
+  (0.0ms) rollback transaction
72
+  (0.0ms) begin transaction
73
+  (0.0ms) rollback transaction
74
+  (0.0ms) begin transaction
75
+  (0.0ms) rollback transaction
76
+ Connecting to database specified by database.yml
77
+  (0.2ms) begin transaction
78
+  (0.0ms) rollback transaction
79
+  (0.0ms) begin transaction
80
+  (0.0ms) rollback transaction
81
+  (0.0ms) begin transaction
82
+  (0.0ms) rollback transaction
83
+  (0.0ms) begin transaction
84
+  (0.0ms) rollback transaction
85
+  (0.0ms) begin transaction
86
+  (0.0ms) rollback transaction
87
+  (0.0ms) begin transaction
88
+  (0.0ms) rollback transaction
89
+  (0.0ms) begin transaction
90
+  (0.0ms) rollback transaction
91
+  (0.0ms) begin transaction
92
+  (0.0ms) rollback transaction
93
+  (0.0ms) begin transaction
94
+  (0.0ms) rollback transaction
95
+  (0.0ms) begin transaction
96
+  (0.0ms) rollback transaction
97
+  (0.0ms) begin transaction
98
+  (0.0ms) rollback transaction
99
+  (0.0ms) begin transaction
100
+  (0.0ms) rollback transaction
101
+  (0.0ms) begin transaction
102
+  (0.0ms) rollback transaction
103
+  (0.0ms) begin transaction
104
+  (0.0ms) rollback transaction
105
+  (0.0ms) begin transaction
106
+  (0.0ms) rollback transaction
107
+  (0.0ms) begin transaction
108
+  (0.0ms) rollback transaction
109
+  (0.0ms) begin transaction
110
+  (0.0ms) rollback transaction
111
+ Connecting to database specified by database.yml
112
+  (0.2ms) begin transaction
113
+  (0.0ms) rollback transaction
114
+  (0.0ms) begin transaction
115
+  (0.0ms) SAVEPOINT active_record_1
116
+ SQL (7.5ms) INSERT INTO "customers" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["email", "andrew.culver@gmail.com"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
117
+  (0.1ms) RELEASE SAVEPOINT active_record_1
118
+  (0.0ms) SAVEPOINT active_record_1
119
+ SQL (0.8ms) INSERT INTO "subscriptions" ("card_type", "coupon_id", "created_at", "current_price", "customer_id", "last_four", "plan_id", "stripe_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["card_type", nil], ["coupon_id", nil], ["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["current_price", nil], ["customer_id", 1], ["last_four", nil], ["plan_id", nil], ["stripe_id", "customer-id"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
120
+  (0.0ms) RELEASE SAVEPOINT active_record_1
121
+  (0.5ms) rollback transaction
122
+  (0.0ms) begin transaction
123
+  (0.0ms) SAVEPOINT active_record_1
124
+ SQL (0.2ms) INSERT INTO "customers" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["email", "andrew.culver@gmail.com"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
125
+  (0.0ms) RELEASE SAVEPOINT active_record_1
126
+  (0.0ms) SAVEPOINT active_record_1
127
+ SQL (0.4ms) INSERT INTO "subscriptions" ("card_type", "coupon_id", "created_at", "current_price", "customer_id", "last_four", "plan_id", "stripe_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["card_type", nil], ["coupon_id", nil], ["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["current_price", nil], ["customer_id", 1], ["last_four", nil], ["plan_id", nil], ["stripe_id", "customer-id"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
128
+  (0.0ms) RELEASE SAVEPOINT active_record_1
129
+  (0.3ms) rollback transaction
130
+  (0.0ms) begin transaction
131
+  (0.0ms) SAVEPOINT active_record_1
132
+ SQL (0.3ms) INSERT INTO "customers" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["email", "andrew.culver@gmail.com"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
133
+  (0.0ms) RELEASE SAVEPOINT active_record_1
134
+  (0.0ms) SAVEPOINT active_record_1
135
+ SQL (0.3ms) INSERT INTO "subscriptions" ("card_type", "coupon_id", "created_at", "current_price", "customer_id", "last_four", "plan_id", "stripe_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["card_type", nil], ["coupon_id", nil], ["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["current_price", nil], ["customer_id", 1], ["last_four", nil], ["plan_id", nil], ["stripe_id", "customer-id"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
136
+  (0.0ms) RELEASE SAVEPOINT active_record_1
137
+  (0.3ms) rollback transaction
138
+  (0.1ms) begin transaction
139
+  (0.0ms) SAVEPOINT active_record_1
140
+ SQL (0.3ms) INSERT INTO "customers" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["email", "andrew.culver@gmail.com"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
141
+  (0.0ms) RELEASE SAVEPOINT active_record_1
142
+  (0.0ms) SAVEPOINT active_record_1
143
+ SQL (0.4ms) INSERT INTO "subscriptions" ("card_type", "coupon_id", "created_at", "current_price", "customer_id", "last_four", "plan_id", "stripe_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["card_type", nil], ["coupon_id", nil], ["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["current_price", nil], ["customer_id", 1], ["last_four", nil], ["plan_id", nil], ["stripe_id", "customer-id"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
144
+  (0.0ms) RELEASE SAVEPOINT active_record_1
145
+  (0.5ms) rollback transaction
146
+  (0.0ms) begin transaction
147
+  (0.0ms) SAVEPOINT active_record_1
148
+ SQL (0.3ms) INSERT INTO "customers" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["email", "andrew.culver@gmail.com"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
149
+  (0.0ms) RELEASE SAVEPOINT active_record_1
150
+  (0.0ms) SAVEPOINT active_record_1
151
+ SQL (0.4ms) INSERT INTO "subscriptions" ("card_type", "coupon_id", "created_at", "current_price", "customer_id", "last_four", "plan_id", "stripe_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["card_type", nil], ["coupon_id", nil], ["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["current_price", nil], ["customer_id", 1], ["last_four", nil], ["plan_id", nil], ["stripe_id", "customer-id"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
152
+  (0.0ms) RELEASE SAVEPOINT active_record_1
153
+  (0.4ms) rollback transaction
154
+  (0.0ms) begin transaction
155
+  (0.0ms) SAVEPOINT active_record_1
156
+ SQL (0.3ms) INSERT INTO "customers" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["email", "andrew.culver@gmail.com"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
157
+  (0.0ms) RELEASE SAVEPOINT active_record_1
158
+  (0.0ms) SAVEPOINT active_record_1
159
+ SQL (0.3ms) INSERT INTO "subscriptions" ("card_type", "coupon_id", "created_at", "current_price", "customer_id", "last_four", "plan_id", "stripe_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["card_type", nil], ["coupon_id", nil], ["created_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00], ["current_price", nil], ["customer_id", 1], ["last_four", nil], ["plan_id", nil], ["stripe_id", "customer-id"], ["updated_at", Sun, 15 Feb 2015 10:37:49 UTC +00:00]]
160
+  (0.0ms) RELEASE SAVEPOINT active_record_1
161
+  (0.3ms) rollback transaction
162
+  (0.0ms) begin transaction
163
+  (0.0ms) rollback transaction
164
+  (0.0ms) begin transaction
165
+  (0.0ms) rollback transaction
166
+  (0.0ms) begin transaction
167
+  (0.0ms) rollback transaction
168
+  (0.0ms) begin transaction
169
+  (0.0ms) rollback transaction
170
+  (0.0ms) begin transaction
171
+  (0.1ms) rollback transaction
172
+  (0.0ms) begin transaction
173
+  (0.0ms) rollback transaction
174
+  (0.0ms) begin transaction
175
+  (0.0ms) rollback transaction
176
+  (0.0ms) begin transaction
177
+  (0.0ms) rollback transaction
178
+  (0.0ms) begin transaction
179
+  (0.0ms) rollback transaction
180
+  (0.0ms) begin transaction
181
+  (0.0ms) rollback transaction
182
+ Connecting to database specified by database.yml
183
+ Connecting to database specified by database.yml
184
+  (0.2ms) begin transaction
185
+  (0.0ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+  (0.0ms) rollback transaction
188
+  (0.0ms) begin transaction
189
+  (0.0ms) rollback transaction
190
+  (0.0ms) begin transaction
191
+  (0.0ms) rollback transaction
192
+  (0.0ms) begin transaction
193
+  (0.0ms) rollback transaction
194
+  (0.0ms) begin transaction
195
+  (0.0ms) rollback transaction
196
+  (0.0ms) begin transaction
197
+  (0.0ms) rollback transaction
198
+  (0.0ms) begin transaction
199
+  (0.0ms) rollback transaction
200
+  (0.0ms) begin transaction
201
+  (0.0ms) rollback transaction
202
+  (0.0ms) begin transaction
203
+  (0.0ms) rollback transaction