stripe_saas 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/concerns/stripe_saas/plan_feature.rb +1 -1
- data/app/concerns/stripe_saas/subscription.rb +1 -1
- data/lib/generators/stripe_saas/templates/app/models/plan.rb +1 -3
- data/lib/stripe_saas/engine.rb +1 -1
- data/lib/stripe_saas/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +104 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f78175401e2d4cef14fddb9cd43fa524f4bb6fcb
|
4
|
+
data.tar.gz: 2848356cfaa6d9d1ad457b7acf2174094d0f6a35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f01a1b81fe8e9b988ce7ddb7e1fb8cc27a8eabc0d09209adc232de58014f7fc68f3626a1da36f632c8b6a22df564d8d620de5e2af96221e0111eb517f9780b6
|
7
|
+
data.tar.gz: d626465c96fde60a7c32fd33cb3defa24364a31c3e6ee2534f56f4fec30e75b7f68ee3c3f3e3d43254af651d06f30cd538fd7e44d9d19b91dee31b389ca9c7e7
|
@@ -5,9 +5,7 @@ class Plan < ActiveRecord::Base
|
|
5
5
|
|
6
6
|
default_scope { order(:display_order) }
|
7
7
|
|
8
|
-
|
9
|
-
scope plan.to_sym, -> { find_by(stripe_id: plan.stripe_id) }
|
10
|
-
end
|
8
|
+
scope :by_stripe_id, lambda { |stripe_id| find_by(stripe_id: stripe_id.to_s) }
|
11
9
|
|
12
10
|
include StripeSaas::Plan
|
13
11
|
end
|
data/lib/stripe_saas/engine.rb
CHANGED
@@ -15,7 +15,7 @@ module StripeSaas
|
|
15
15
|
end
|
16
16
|
|
17
17
|
initializer 'stripe_saas.create_plans' do |app|
|
18
|
-
if StripeSaas.create_plans_in_stripe?
|
18
|
+
if StripeSaas.create_plans_in_stripe? && !Rails.env.test?
|
19
19
|
begin
|
20
20
|
::Plan.all.each do |plan|
|
21
21
|
unless StripeSaas.non_stripe_plans.include?(plan.stripe_id)
|
data/lib/stripe_saas/version.rb
CHANGED
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/log/test.log
CHANGED
@@ -3530,3 +3530,107 @@ Migrating to CreatePlanFeatures (20151220161817)
|
|
3530
3530
|
[1m[35m (1.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3531
3531
|
[1m[36m (1.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3532
3532
|
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3533
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3534
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "description" varchar, "feature_type" varchar, "unit" varchar, "display_order" integer, "use_unit" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3535
|
+
[1m[35m (1.8ms)[0m CREATE TABLE "plan_features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" varchar, "display_value" varchar, "plan_id" integer, "feature_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
3536
|
+
[1m[36m (1.3ms)[0m [1mCREATE 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3537
|
+
[1m[35m (1.7ms)[0m 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)
|
3538
|
+
[1m[36m (2.2ms)[0m [1mCREATE 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) [0m
|
3539
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3540
|
+
[1m[36m (1.8ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
3541
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
3542
|
+
FROM sqlite_master
|
3543
|
+
WHERE name='index_users_on_email' AND type='index'
|
3544
|
+
UNION ALL
|
3545
|
+
SELECT sql
|
3546
|
+
FROM sqlite_temp_master
|
3547
|
+
WHERE name='index_users_on_email' AND type='index'
|
3548
|
+
|
3549
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
3550
|
+
[1m[35m (2.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
3551
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3552
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3553
|
+
[1m[36m (1.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161817')[0m
|
3554
|
+
[1m[35m (1.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
|
3555
|
+
[1m[36m (1.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150102001921')[0m
|
3556
|
+
[1m[35m (2.4ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3557
|
+
[1m[36m (1.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3558
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3559
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3560
|
+
[1m[36m (2.0ms)[0m [1mCREATE TABLE "features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "description" varchar, "feature_type" varchar, "unit" varchar, "display_order" integer, "use_unit" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3561
|
+
[1m[35m (1.8ms)[0m CREATE TABLE "plan_features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" varchar, "display_value" varchar, "plan_id" integer, "feature_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
3562
|
+
[1m[36m (2.0ms)[0m [1mCREATE 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3563
|
+
[1m[35m (1.9ms)[0m 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)
|
3564
|
+
[1m[36m (2.1ms)[0m [1mCREATE 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) [0m
|
3565
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3566
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
3567
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3568
|
+
FROM sqlite_master
|
3569
|
+
WHERE name='index_users_on_email' AND type='index'
|
3570
|
+
UNION ALL
|
3571
|
+
SELECT sql
|
3572
|
+
FROM sqlite_temp_master
|
3573
|
+
WHERE name='index_users_on_email' AND type='index'
|
3574
|
+
|
3575
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
3576
|
+
[1m[35m (1.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
3577
|
+
[1m[36m (2.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3578
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3579
|
+
[1m[36m (1.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161817')[0m
|
3580
|
+
[1m[35m (1.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
|
3581
|
+
[1m[36m (1.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150102001921')[0m
|
3582
|
+
[1m[35m (1.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3583
|
+
[1m[36m (1.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3584
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3585
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3586
|
+
[1m[36m (2.3ms)[0m [1mCREATE TABLE "features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "description" varchar, "feature_type" varchar, "unit" varchar, "display_order" integer, "use_unit" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3587
|
+
[1m[35m (2.9ms)[0m CREATE TABLE "plan_features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" varchar, "display_value" varchar, "plan_id" integer, "feature_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
3588
|
+
[1m[36m (1.6ms)[0m [1mCREATE 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3589
|
+
[1m[35m (1.5ms)[0m 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)
|
3590
|
+
[1m[36m (2.0ms)[0m [1mCREATE 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) [0m
|
3591
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3592
|
+
[1m[36m (2.8ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
3593
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3594
|
+
FROM sqlite_master
|
3595
|
+
WHERE name='index_users_on_email' AND type='index'
|
3596
|
+
UNION ALL
|
3597
|
+
SELECT sql
|
3598
|
+
FROM sqlite_temp_master
|
3599
|
+
WHERE name='index_users_on_email' AND type='index'
|
3600
|
+
|
3601
|
+
[1m[36m (3.6ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
3602
|
+
[1m[35m (1.7ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
3603
|
+
[1m[36m (1.5ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3604
|
+
[1m[35m (0.2ms)[0m SELECT version FROM "schema_migrations"
|
3605
|
+
[1m[36m (2.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161817')[0m
|
3606
|
+
[1m[35m (1.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
|
3607
|
+
[1m[36m (1.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150102001921')[0m
|
3608
|
+
[1m[35m (2.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3609
|
+
[1m[36m (1.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3610
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3611
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3612
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "description" varchar, "feature_type" varchar, "unit" varchar, "display_order" integer, "use_unit" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3613
|
+
[1m[35m (2.4ms)[0m CREATE TABLE "plan_features" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "value" varchar, "display_value" varchar, "plan_id" integer, "feature_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
3614
|
+
[1m[36m (1.8ms)[0m [1mCREATE 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
3615
|
+
[1m[35m (1.9ms)[0m 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)
|
3616
|
+
[1m[36m (1.9ms)[0m [1mCREATE 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) [0m
|
3617
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3618
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
3619
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3620
|
+
FROM sqlite_master
|
3621
|
+
WHERE name='index_users_on_email' AND type='index'
|
3622
|
+
UNION ALL
|
3623
|
+
SELECT sql
|
3624
|
+
FROM sqlite_temp_master
|
3625
|
+
WHERE name='index_users_on_email' AND type='index'
|
3626
|
+
|
3627
|
+
[1m[36m (1.8ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
3628
|
+
[1m[35m (1.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
3629
|
+
[1m[36m (1.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3630
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3631
|
+
[1m[36m (1.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161817')[0m
|
3632
|
+
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
|
3633
|
+
[1m[36m (1.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150102001921')[0m
|
3634
|
+
[1m[35m (3.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3635
|
+
[1m[36m (1.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3636
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe_saas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Sam-Bodden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
version: '0'
|
226
226
|
requirements: []
|
227
227
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.
|
228
|
+
rubygems_version: 2.5.2
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: Stripe Payments/Subscription Engine for Rails 4.
|