stripe_saas 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.asc +159 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/stripe_saas/application.js +13 -0
  6. data/app/assets/stylesheets/stripe_saas/application.css +15 -0
  7. data/app/concerns/stripe_saas/feature.rb +23 -0
  8. data/app/concerns/stripe_saas/plan.rb +45 -0
  9. data/app/concerns/stripe_saas/plan_feature.rb +25 -0
  10. data/app/concerns/stripe_saas/subscription.rb +182 -0
  11. data/app/controllers/stripe_saas/application_controller.rb +5 -0
  12. data/app/controllers/stripe_saas/subscriptions_controller.rb +200 -0
  13. data/app/helpers/stripe_saas/application_helper.rb +26 -0
  14. data/app/views/stripe_saas/subscriptions/_card.html.erb +51 -0
  15. data/app/views/stripe_saas/subscriptions/_card_form.html.erb +42 -0
  16. data/app/views/stripe_saas/subscriptions/_pricing_table.html.erb +43 -0
  17. data/app/views/stripe_saas/subscriptions/edit.html.erb +7 -0
  18. data/app/views/stripe_saas/subscriptions/index.html.erb +2 -0
  19. data/app/views/stripe_saas/subscriptions/new.html.erb +1 -0
  20. data/app/views/stripe_saas/subscriptions/show.html.erb +15 -0
  21. data/app/views/stripe_saas/subscriptions/unauthorized.html.erb +1 -0
  22. data/config/environment.rb +0 -0
  23. data/config/routes.rb +10 -0
  24. data/lib/generators/stripe_saas/install_generator.rb +60 -0
  25. data/lib/generators/stripe_saas/templates/app/models/feature.rb +8 -0
  26. data/lib/generators/stripe_saas/templates/app/models/plan.rb +9 -0
  27. data/lib/generators/stripe_saas/templates/app/models/plan_feature.rb +6 -0
  28. data/lib/generators/stripe_saas/templates/app/models/subscription.rb +5 -0
  29. data/lib/generators/stripe_saas/templates/config/initializers/stripe_saas.rb +7 -0
  30. data/lib/generators/stripe_saas/views_generator.rb +20 -0
  31. data/lib/stripe_saas.rb +9 -0
  32. data/lib/stripe_saas/configuration.rb +51 -0
  33. data/lib/stripe_saas/engine.rb +41 -0
  34. data/lib/stripe_saas/version.rb +3 -0
  35. data/lib/tasks/stripe_saas_tasks.rake +11 -0
  36. data/spec/concerns/plan_spec.rb +50 -0
  37. data/spec/dummy/README.rdoc +28 -0
  38. data/spec/dummy/Rakefile +6 -0
  39. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  40. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  41. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  42. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  43. data/spec/dummy/app/models/plan.rb +7 -0
  44. data/spec/dummy/app/models/subscription.rb +5 -0
  45. data/spec/dummy/app/models/user.rb +8 -0
  46. data/spec/dummy/app/views/layouts/application.html.erb +16 -0
  47. data/spec/dummy/bin/bundle +3 -0
  48. data/spec/dummy/bin/rails +4 -0
  49. data/spec/dummy/bin/rake +4 -0
  50. data/spec/dummy/bin/setup +29 -0
  51. data/spec/dummy/config.ru +4 -0
  52. data/spec/dummy/config/application.rb +27 -0
  53. data/spec/dummy/config/boot.rb +5 -0
  54. data/spec/dummy/config/database.yml +25 -0
  55. data/spec/dummy/config/environment.rb +5 -0
  56. data/spec/dummy/config/environments/development.rb +41 -0
  57. data/spec/dummy/config/environments/production.rb +79 -0
  58. data/spec/dummy/config/environments/test.rb +42 -0
  59. data/spec/dummy/config/initializers/assets.rb +11 -0
  60. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  61. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  62. data/spec/dummy/config/initializers/devise.rb +259 -0
  63. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  64. data/spec/dummy/config/initializers/inflections.rb +16 -0
  65. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  66. data/spec/dummy/config/initializers/session_store.rb +3 -0
  67. data/spec/dummy/config/initializers/stripe_saas.rb +7 -0
  68. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  69. data/spec/dummy/config/locales/devise.en.yml +60 -0
  70. data/spec/dummy/config/locales/en.yml +23 -0
  71. data/spec/dummy/config/routes.rb +10 -0
  72. data/spec/dummy/config/secrets.yml +22 -0
  73. data/spec/dummy/db/development.sqlite3 +0 -0
  74. data/spec/dummy/db/migrate/20150101233243_devise_create_users.rb +42 -0
  75. data/spec/dummy/db/migrate/20150102001921_create_subscriptions.rb +14 -0
  76. data/spec/dummy/db/migrate/20150102001930_create_plans.rb +19 -0
  77. data/spec/dummy/db/schema.rb +61 -0
  78. data/spec/dummy/db/test.sqlite3 +0 -0
  79. data/spec/dummy/log/development.log +170 -0
  80. data/spec/dummy/log/test.log +110 -0
  81. data/spec/dummy/public/404.html +67 -0
  82. data/spec/dummy/public/422.html +67 -0
  83. data/spec/dummy/public/500.html +66 -0
  84. data/spec/dummy/public/favicon.ico +0 -0
  85. data/spec/integration/navigation_test.rb +9 -0
  86. data/spec/rails_helper.rb +23 -0
  87. data/spec/spec_helper.rb +22 -0
  88. metadata +278 -0
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,7 @@
1
+ StripeSaas.setup do |config|
2
+ config.subscriptions_owned_by = :user
3
+ # config.devise_scope = :user
4
+ config.stripe_publishable_key = ENV['STRIPE_PUBLISHABLE_KEY']
5
+ config.stripe_secret_key = ENV['STRIPE_SECRET_KEY']
6
+ config.create_plans_in_stripe = false
7
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,60 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password has been changed successfully. You are now signed in."
34
+ updated_not_active: "Your password has been changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
42
+ updated: "Your account has been updated successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ already_signed_out: "Signed out successfully."
47
+ unlocks:
48
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
+ errors:
52
+ messages:
53
+ already_confirmed: "was already confirmed, please try signing in"
54
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
+ expired: "has expired, please request a new one"
56
+ not_found: "not found"
57
+ not_locked: "was not locked"
58
+ not_saved:
59
+ one: "1 error prohibited this %{resource} from being saved:"
60
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,10 @@
1
+ Rails.application.routes.draw do
2
+ # Added by StripeSaas.
3
+ mount StripeSaas::Engine, at: 'stripe_saas'
4
+ scope module: 'stripe_saas' do
5
+ get 'pricing' => 'subscriptions#index', as: 'pricing'
6
+ end
7
+
8
+ devise_for :users
9
+ root 'home#index'
10
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 422340e47b1a608338f387ec4bf9d3e60dd404c2bd3ee62a6e795c4d119328ae512b90432e9e2dbcd9bd3b297f3f113cab1b86bbf901c29a20524b2d04edef1b
15
+
16
+ test:
17
+ secret_key_base: 9d7b775637dff95acd3abc1e365a63c50823cfcd8705ecad6a391e961f69eabfc5eb22078e24b1cd531557665c2057ed5e764446e33cc36b8a93c7dd4058f645
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Binary file
@@ -0,0 +1,42 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, null: false, default: ""
6
+ t.string :encrypted_password, null: false, default: ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, default: 0, null: false
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+
34
+ t.timestamps
35
+ end
36
+
37
+ add_index :users, :email, unique: true
38
+ add_index :users, :reset_password_token, unique: true
39
+ # add_index :users, :confirmation_token, unique: true
40
+ # add_index :users, :unlock_token, unique: true
41
+ end
42
+ end
@@ -0,0 +1,14 @@
1
+ class CreateSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ create_table :subscriptions do |t|
4
+ t.string :stripe_id
5
+ t.integer :plan_id
6
+ t.string :last_four
7
+ t.string :card_type
8
+ t.integer :current_price_cents
9
+ t.integer :user_id
10
+
11
+ t.timestamps null: false
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ class CreatePlans < ActiveRecord::Migration
2
+ def change
3
+ create_table :plans do |t|
4
+ t.string :stripe_id
5
+ t.string :name
6
+ t.integer :price_cents
7
+ t.string :interval
8
+ t.integer :interval_count
9
+ t.integer :trial_period_days
10
+ t.text :metadata_as_json
11
+ t.text :statement_descriptor
12
+ t.text :features_as_json
13
+ t.boolean :highlight
14
+ t.integer :display_order
15
+
16
+ t.timestamps null: false
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,61 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150102001930) do
15
+
16
+ create_table "plans", force: :cascade do |t|
17
+ t.string "stripe_id"
18
+ t.string "name"
19
+ t.integer "price_cents"
20
+ t.string "interval"
21
+ t.integer "interval_count"
22
+ t.integer "trial_period_days"
23
+ t.text "metadata_as_json"
24
+ t.text "statement_descriptor"
25
+ t.text "features_as_json"
26
+ t.boolean "highlight"
27
+ t.integer "display_order"
28
+ t.datetime "created_at", null: false
29
+ t.datetime "updated_at", null: false
30
+ end
31
+
32
+ create_table "subscriptions", force: :cascade do |t|
33
+ t.string "stripe_id"
34
+ t.integer "plan_id"
35
+ t.string "last_four"
36
+ t.string "card_type"
37
+ t.integer "current_price_cents"
38
+ t.integer "user_id"
39
+ t.datetime "created_at", null: false
40
+ t.datetime "updated_at", null: false
41
+ end
42
+
43
+ create_table "users", force: :cascade do |t|
44
+ t.string "email", default: "", null: false
45
+ t.string "encrypted_password", default: "", null: false
46
+ t.string "reset_password_token"
47
+ t.datetime "reset_password_sent_at"
48
+ t.datetime "remember_created_at"
49
+ t.integer "sign_in_count", default: 0, null: false
50
+ t.datetime "current_sign_in_at"
51
+ t.datetime "last_sign_in_at"
52
+ t.string "current_sign_in_ip"
53
+ t.string "last_sign_in_ip"
54
+ t.datetime "created_at"
55
+ t.datetime "updated_at"
56
+ end
57
+
58
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
59
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
60
+
61
+ end
Binary file
@@ -0,0 +1,170 @@
1
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.5ms) select sqlite_version(*)
3
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to DeviseCreateUsers (20150101233243)
6
+  (0.1ms) begin transaction
7
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/bsb/Projects/integrallis-open-source/stripe_saas/spec/dummy/db/migrate/20150101233243_devise_create_users.rb:34)
8
+  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime, "updated_at" datetime)
9
+  (1.4ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
10
+  (0.1ms) SELECT sql
11
+ FROM sqlite_master
12
+ WHERE name='index_users_on_email' AND type='index'
13
+ UNION ALL
14
+ SELECT sql
15
+ FROM sqlite_temp_master
16
+ WHERE name='index_users_on_email' AND type='index'
17
+
18
+  (0.2ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
19
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150101233243"]]
20
+  (1.1ms) commit transaction
21
+ Migrating to CreateSubscriptions (20150102001921)
22
+  (0.1ms) begin transaction
23
+  (0.4ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
24
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150102001921"]]
25
+  (0.8ms) commit transaction
26
+ Migrating to CreatePlans (20150102001930)
27
+  (0.1ms) begin transaction
28
+  (0.4ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "stripe_id" varchar, "price_cents" integer, "interval" varchar, "features" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
29
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150102001930"]]
30
+  (0.8ms) commit transaction
31
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
32
+  (0.1ms)  SELECT sql
33
+ FROM sqlite_master
34
+ WHERE name='index_users_on_reset_password_token' AND type='index'
35
+ UNION ALL
36
+ SELECT sql
37
+ FROM sqlite_temp_master
38
+ WHERE name='index_users_on_reset_password_token' AND type='index'
39
+ 
40
+  (0.1ms) SELECT sql
41
+ FROM sqlite_master
42
+ WHERE name='index_users_on_email' AND type='index'
43
+ UNION ALL
44
+ SELECT sql
45
+ FROM sqlite_temp_master
46
+ WHERE name='index_users_on_email' AND type='index'
47
+
48
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
49
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
50
+ Migrating to CreatePlans (20150102001930)
51
+  (0.1ms) begin transaction
52
+  (2.4ms) DROP TABLE "plans"
53
+ SQL (0.3ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20150102001930"]]
54
+  (1.0ms) commit transaction
55
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
56
+  (0.2ms) SELECT sql
57
+ FROM sqlite_master
58
+ WHERE name='index_users_on_reset_password_token' AND type='index'
59
+ UNION ALL
60
+ SELECT sql
61
+ FROM sqlite_temp_master
62
+ WHERE name='index_users_on_reset_password_token' AND type='index'
63
+
64
+  (0.2ms)  SELECT sql
65
+ FROM sqlite_master
66
+ WHERE name='index_users_on_email' AND type='index'
67
+ UNION ALL
68
+ SELECT sql
69
+ FROM sqlite_temp_master
70
+ WHERE name='index_users_on_email' AND type='index'
71
+ 
72
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
73
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
74
+ Migrating to CreateSubscriptions (20150102001921)
75
+  (0.1ms) begin transaction
76
+  (0.5ms) DROP TABLE "subscriptions"
77
+ SQL (0.3ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20150102001921"]]
78
+  (0.9ms) commit transaction
79
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
80
+  (0.3ms) SELECT sql
81
+ FROM sqlite_master
82
+ WHERE name='index_users_on_reset_password_token' AND type='index'
83
+ UNION ALL
84
+ SELECT sql
85
+ FROM sqlite_temp_master
86
+ WHERE name='index_users_on_reset_password_token' AND type='index'
87
+
88
+  (0.2ms)  SELECT sql
89
+ FROM sqlite_master
90
+ WHERE name='index_users_on_email' AND type='index'
91
+ UNION ALL
92
+ SELECT sql
93
+ FROM sqlite_temp_master
94
+ WHERE name='index_users_on_email' AND type='index'
95
+ 
96
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
97
+ Migrating to CreateSubscriptions (20150102001921)
98
+  (0.1ms) begin transaction
99
+  (0.9ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
100
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150102001921"]]
101
+  (0.9ms) commit transaction
102
+ Migrating to CreatePlans (20150102001930)
103
+  (0.1ms) begin transaction
104
+  (0.4ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
105
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150102001930"]]
106
+  (1.1ms) commit transaction
107
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
108
+  (0.3ms)  SELECT sql
109
+ FROM sqlite_master
110
+ WHERE name='index_users_on_reset_password_token' AND type='index'
111
+ UNION ALL
112
+ SELECT sql
113
+ FROM sqlite_temp_master
114
+ WHERE name='index_users_on_reset_password_token' AND type='index'
115
+ 
116
+  (0.4ms) SELECT sql
117
+ FROM sqlite_master
118
+ WHERE name='index_users_on_email' AND type='index'
119
+ UNION ALL
120
+ SELECT sql
121
+ FROM sqlite_temp_master
122
+ WHERE name='index_users_on_email' AND type='index'
123
+
124
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
125
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
126
+ Migrating to CreatePlans (20150102001930)
127
+  (0.1ms) begin transaction
128
+  (1.2ms) DROP TABLE "plans"
129
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20150102001930"]]
130
+  (0.8ms) commit transaction
131
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
132
+  (0.1ms) SELECT sql
133
+ FROM sqlite_master
134
+ WHERE name='index_users_on_reset_password_token' AND type='index'
135
+ UNION ALL
136
+ SELECT sql
137
+ FROM sqlite_temp_master
138
+ WHERE name='index_users_on_reset_password_token' AND type='index'
139
+
140
+  (0.1ms)  SELECT sql
141
+ FROM sqlite_master
142
+ WHERE name='index_users_on_email' AND type='index'
143
+ UNION ALL
144
+ SELECT sql
145
+ FROM sqlite_temp_master
146
+ WHERE name='index_users_on_email' AND type='index'
147
+ 
148
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
149
+ Migrating to CreatePlans (20150102001930)
150
+  (0.1ms) begin transaction
151
+  (0.6ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "statement_descriptor" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
152
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150102001930"]]
153
+  (0.9ms) commit transaction
154
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
155
+  (0.1ms)  SELECT sql
156
+ FROM sqlite_master
157
+ WHERE name='index_users_on_reset_password_token' AND type='index'
158
+ UNION ALL
159
+ SELECT sql
160
+ FROM sqlite_temp_master
161
+ WHERE name='index_users_on_reset_password_token' AND type='index'
162
+ 
163
+  (0.1ms) SELECT sql
164
+ FROM sqlite_master
165
+ WHERE name='index_users_on_email' AND type='index'
166
+ UNION ALL
167
+ SELECT sql
168
+ FROM sqlite_temp_master
169
+ WHERE name='index_users_on_email' AND type='index'
170
+