stripe_saas 0.0.8 → 0.0.9

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: c92e60e4506a887cc92abe8ffcf8438355152d14
4
- data.tar.gz: 8e15c4fca16ebd1ef6bf3c347546c9c5f79a84fd
3
+ metadata.gz: f3bb60f9f2dc68e391d9823f0814f3181d32509f
4
+ data.tar.gz: e5703d953faa91febb540c6420479cdf11b9c84f
5
5
  SHA512:
6
- metadata.gz: 21b96facae4217453da88a990b0b9d197b747badb2667915cbd0425baeed1408b0d237af5b426f36648471b560d736756225edee3d70bb3077d4bc419a177555
7
- data.tar.gz: 00eff34be9533e60277d7368de0a6cb189ec1dd5d4cdeb5c1dfa92606f497bc4c49d4eab4fb0fa1c7fa3d44f5540b1ec13c6e7e7230c84c8ecdf7b076251ba6d
6
+ metadata.gz: e04ee02b170be8f1daa1a613667bb7d771e12fa9524fdbfa39c02e3dfe6a569e9f00fb9145971a306b974935c1c7764852f7b1bd2535aa25ef8701d761ec4441
7
+ data.tar.gz: 05587ac5b9e4cbd613919caa416642d8e60ad4b8b3b50f5aa5635b0140008db1efcf8201f68c02924f6d88626e38078c4f26145c7ef7dc2bede4f3c0fa59e297
@@ -11,7 +11,7 @@ module StripeSaas::Subscription
11
11
  belongs_to :plan
12
12
 
13
13
  # update details.
14
- before_save :processing!, unless: "Rails.env.test?"
14
+ before_save :processing!, unless: Proc.new { Rails.env.test? }
15
15
 
16
16
  def processing!
17
17
  # if their package level has changed ..
@@ -84,15 +84,15 @@ module StripeSaas
84
84
  plan = ::Plan.by_stripe_id(params[:plan]).try(:first)
85
85
  end
86
86
 
87
+ devise_scope = (StripeSaas.devise_scope || StripeSaas.subscriptions_owned_by).to_s
88
+
87
89
  if plan
88
90
  unless plan.free?
89
91
  session["user_return_to"] = new_subscription_path(plan: plan)
90
92
  end
91
-
92
- devise_scope = (StripeSaas.devise_scope || StripeSaas.subscriptions_owned_by).to_s
93
93
  redirect_to new_registration_path(devise_scope, plan: plan)
94
94
  else
95
- redirect_to new_registration_path
95
+ redirect_to new_registration_path(devise_scope)
96
96
  end
97
97
  end
98
98
 
@@ -27,10 +27,10 @@
27
27
  <ul>
28
28
  <% plan.plan_features.each do |plan_feature| %>
29
29
  <li>
30
- <% if plan_feature.feature.feature_type == 'boolean' %>
30
+ <% if plan_feature.feature.feature_type != 'boolean' %>
31
31
  <%= plan_feature.value > 0 ? number_with_delimiter(plan_feature.value) : "No" %> <%= plan_feature.feature.description %>
32
32
  <% else %>
33
- <%= pf.value ? '&#10004;' : '&#10006;' %> <%= pf.feature.description %>
33
+ <%= plan_feature.value ? '&#10004;'.html_safe : '&#10006;'.html_safe %> <%= plan_feature.feature.description %>
34
34
  <% end %>
35
35
  </li>
36
36
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module StripeSaas
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
Binary file
@@ -3790,3 +3790,133 @@ Migrating to CreatePlanFeatures (20151220161817)
3790
3790
   (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3791
3791
   (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3792
3792
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3793
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3794
+  (1.6ms) CREATE 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) 
3795
+  (3.1ms) 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)
3796
+  (2.3ms) 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3797
+  (2.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)
3798
+  (1.7ms) 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) 
3799
+  (1.9ms) select sqlite_version(*)
3800
+  (2.0ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3801
+  (0.1ms) SELECT sql
3802
+ FROM sqlite_master
3803
+ WHERE name='index_users_on_email' AND type='index'
3804
+ UNION ALL
3805
+ SELECT sql
3806
+ FROM sqlite_temp_master
3807
+ WHERE name='index_users_on_email' AND type='index'
3808
+
3809
+  (1.6ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3810
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3811
+  (3.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3812
+  (0.1ms) SELECT version FROM "schema_migrations"
3813
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3814
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3815
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3816
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3817
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3818
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3819
+ ActiveRecord::SchemaMigration Load (2.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
3820
+  (2.0ms) CREATE 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) 
3821
+  (1.8ms) 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)
3822
+  (2.5ms) 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3823
+  (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)
3824
+  (1.4ms) 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) 
3825
+  (0.1ms) select sqlite_version(*)
3826
+  (1.2ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3827
+  (0.1ms) SELECT sql
3828
+ FROM sqlite_master
3829
+ WHERE name='index_users_on_email' AND type='index'
3830
+ UNION ALL
3831
+ SELECT sql
3832
+ FROM sqlite_temp_master
3833
+ WHERE name='index_users_on_email' AND type='index'
3834
+
3835
+  (0.8ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3836
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3837
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3838
+  (0.1ms) SELECT version FROM "schema_migrations"
3839
+  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3840
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3841
+  (3.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3842
+  (2.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3843
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3844
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3845
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3846
+  (7.6ms) CREATE 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) 
3847
+  (1.6ms) 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)
3848
+  (1.0ms) 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3849
+  (1.0ms) 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)
3850
+  (4.0ms) 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) 
3851
+  (2.8ms) select sqlite_version(*)
3852
+  (1.8ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3853
+  (0.1ms) SELECT sql
3854
+ FROM sqlite_master
3855
+ WHERE name='index_users_on_email' AND type='index'
3856
+ UNION ALL
3857
+ SELECT sql
3858
+ FROM sqlite_temp_master
3859
+ WHERE name='index_users_on_email' AND type='index'
3860
+
3861
+  (1.5ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3862
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3863
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3864
+  (0.1ms) SELECT version FROM "schema_migrations"
3865
+  (3.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3866
+  (5.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3867
+  (4.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3868
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3869
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3870
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
3871
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
3872
+  (1.9ms) CREATE 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) 
3873
+  (1.9ms) 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)
3874
+  (2.1ms) 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3875
+  (1.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)
3876
+  (2.4ms) 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) 
3877
+  (0.1ms) select sqlite_version(*)
3878
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3879
+  (0.3ms) SELECT sql
3880
+ FROM sqlite_master
3881
+ WHERE name='index_users_on_email' AND type='index'
3882
+ UNION ALL
3883
+ SELECT sql
3884
+ FROM sqlite_temp_master
3885
+ WHERE name='index_users_on_email' AND type='index'
3886
+
3887
+  (1.2ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3888
+  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3889
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3890
+  (0.2ms) SELECT version FROM "schema_migrations"
3891
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3892
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3893
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3894
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3895
+  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3896
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3897
+ ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3898
+  (2.0ms) CREATE 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) 
3899
+  (1.5ms) 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)
3900
+  (1.5ms) 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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3901
+  (1.3ms) 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)
3902
+  (2.2ms) 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) 
3903
+  (0.2ms) select sqlite_version(*)
3904
+  (2.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3905
+  (0.2ms) SELECT sql
3906
+ FROM sqlite_master
3907
+ WHERE name='index_users_on_email' AND type='index'
3908
+ UNION ALL
3909
+ SELECT sql
3910
+ FROM sqlite_temp_master
3911
+ WHERE name='index_users_on_email' AND type='index'
3912
+
3913
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3914
+  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3915
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3916
+  (0.1ms) SELECT version FROM "schema_migrations"
3917
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3918
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3919
+  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3920
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3921
+  (4.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3922
+ ActiveRecord::SchemaMigration Load (0.2ms) 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.8
4
+ version: 0.0.9
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: 2017-05-31 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails