stripe_saas 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/stripe_saas/subscriptions_controller.rb +16 -3
- data/lib/stripe_saas/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf4021227c337b34c71aefdfe939c64b19d4d9ca
|
4
|
+
data.tar.gz: 3034aa654da34ed9aea889dce314a6fe5d2ebc55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c77bd85fd0842b18e3bd335924fdbd66ee2ffc888db6baa837e70686d3763dd5d7cfced580130e7da1c9ee551b3d35883f775fb08f01b78f3b9f5601660950a1
|
7
|
+
data.tar.gz: 18a6f2dbff9003d8ae9759d4afff37281c2ea53afe760427d550c42b57a1d2ed7e0f992cff8c24c35a1bb56a283434674a62b5a717d08c736dcc7fe67502c885
|
@@ -78,9 +78,22 @@ module StripeSaas
|
|
78
78
|
def redirect_to_sign_up
|
79
79
|
# this is a Devise default variable and thus should not change its name
|
80
80
|
# when we change subscription owners from :user to :company
|
81
|
-
|
82
|
-
|
83
|
-
|
81
|
+
begin
|
82
|
+
plan = ::Plan.find(params[:plan])
|
83
|
+
rescue ActiveRecord::RecordNotFound
|
84
|
+
plan = ::Plan.by_stripe_id(params[:plan])
|
85
|
+
end
|
86
|
+
|
87
|
+
if plan
|
88
|
+
unless plan.free?
|
89
|
+
session["user_return_to"] = new_subscription_path(plan: plan)
|
90
|
+
end
|
91
|
+
|
92
|
+
devise_scope = (StripeSaas.devise_scope || StripeSaas.subscriptions_owned_by).to_s
|
93
|
+
redirect_to new_registration_path(devise_scope, plan: plan)
|
94
|
+
else
|
95
|
+
redirect_to new_registration_path
|
96
|
+
end
|
84
97
|
end
|
85
98
|
|
86
99
|
def index
|
data/lib/stripe_saas/version.rb
CHANGED
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/log/test.log
CHANGED
@@ -3634,3 +3634,29 @@ Migrating to CreatePlanFeatures (20151220161817)
|
|
3634
3634
|
[1m[35m (3.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3635
3635
|
[1m[36m (1.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3636
3636
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3637
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3638
|
+
[1m[36m (3.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
|
3639
|
+
[1m[35m (1.7ms)[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)
|
3640
|
+
[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
|
3641
|
+
[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)
|
3642
|
+
[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
|
3643
|
+
[1m[35m (1.6ms)[0m select sqlite_version(*)
|
3644
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
3645
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3646
|
+
FROM sqlite_master
|
3647
|
+
WHERE name='index_users_on_email' AND type='index'
|
3648
|
+
UNION ALL
|
3649
|
+
SELECT sql
|
3650
|
+
FROM sqlite_temp_master
|
3651
|
+
WHERE name='index_users_on_email' AND type='index'
|
3652
|
+
|
3653
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
3654
|
+
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
3655
|
+
[1m[36m (1.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3656
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3657
|
+
[1m[36m (1.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161817')[0m
|
3658
|
+
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
|
3659
|
+
[1m[36m (0.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150102001921')[0m
|
3660
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
|
3661
|
+
[1m[36m (1.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220161809')[0m
|
3662
|
+
[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.6
|
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-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|