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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e683d926b99d47e967cde412ccf290153f5cac08
4
- data.tar.gz: 9caf9845349a7b64dcb429c86676853cf53447fa
3
+ metadata.gz: f78175401e2d4cef14fddb9cd43fa524f4bb6fcb
4
+ data.tar.gz: 2848356cfaa6d9d1ad457b7acf2174094d0f6a35
5
5
  SHA512:
6
- metadata.gz: bcfed1599303739ebb5e09a1e2641abe568a7d5eeb1979d401d975c306d9ea90fa18794478280d81c518c59c2038463a285c4287f31b8ffa236b5776f9d9a284
7
- data.tar.gz: 26811659cdf3b5d511680f963e70485a32b9eee4f4e0b2fd0d90b1e3b0e0c4b8014108244b797112bf9a0f742c452f9d2aaa9789764f28232c2f848313981c6d
6
+ metadata.gz: 1f01a1b81fe8e9b988ce7ddb7e1fb8cc27a8eabc0d09209adc232de58014f7fc68f3626a1da36f632c8b6a22df564d8d620de5e2af96221e0111eb517f9780b6
7
+ data.tar.gz: d626465c96fde60a7c32fd33cb3defa24364a31c3e6ee2534f56f4fec30e75b7f68ee3c3f3e3d43254af651d06f30cd538fd7e44d9d19b91dee31b389ca9c7e7
@@ -14,7 +14,7 @@ module StripeSaas::PlanFeature
14
14
  end
15
15
  end
16
16
 
17
- def to_s()
17
+ def to_s
18
18
  case feature.feature_type.to_sym
19
19
  when :boolean
20
20
  "#{self.value ? '' : 'No '}#{self.feature.name}"
@@ -11,7 +11,7 @@ module StripeSaas::Subscription
11
11
  belongs_to :plan
12
12
 
13
13
  # update details.
14
- before_save :processing!
14
+ before_save :processing!, unless: "Rails.env.test?"
15
15
 
16
16
  def processing!
17
17
  # if their package level has changed ..
@@ -5,9 +5,7 @@ class Plan < ActiveRecord::Base
5
5
 
6
6
  default_scope { order(:display_order) }
7
7
 
8
- self.all.each do |plan|
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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module StripeSaas
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
Binary file
@@ -3530,3 +3530,107 @@ Migrating to CreatePlanFeatures (20151220161817)
3530
3530
   (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3531
3531
   (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3532
3532
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
3533
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
3534
+  (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) 
3535
+  (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)
3536
+  (1.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) 
3537
+  (1.7ms) 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
+  (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) 
3539
+  (0.1ms) select sqlite_version(*)
3540
+  (1.8ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3541
+  (0.2ms) 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
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3550
+  (2.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3551
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3552
+  (0.1ms) SELECT version FROM "schema_migrations"
3553
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3554
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3555
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3556
+  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3557
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3558
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3559
+ ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3560
+  (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) 
3561
+  (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)
3562
+  (2.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) 
3563
+  (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)
3564
+  (2.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) 
3565
+  (0.1ms) select sqlite_version(*)
3566
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3567
+  (0.1ms) 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
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3576
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3577
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3578
+  (0.1ms) SELECT version FROM "schema_migrations"
3579
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3580
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3581
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3582
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3583
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3584
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3585
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3586
+  (2.3ms) 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) 
3587
+  (2.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)
3588
+  (1.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, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3589
+  (1.5ms) 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
+  (2.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) 
3591
+  (0.1ms) select sqlite_version(*)
3592
+  (2.8ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3593
+  (0.1ms) 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
+  (3.6ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3602
+  (1.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3603
+  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3604
+  (0.2ms) SELECT version FROM "schema_migrations"
3605
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3606
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3607
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3608
+  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3609
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3610
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3611
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3612
+  (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) 
3613
+  (2.4ms) 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
+  (1.8ms) 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) 
3615
+  (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)
3616
+  (1.9ms) 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) 
3617
+  (0.1ms) select sqlite_version(*)
3618
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
3619
+  (0.1ms) 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
+  (1.8ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
3628
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
3629
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3630
+  (0.1ms) SELECT version FROM "schema_migrations"
3631
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161817')
3632
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
3633
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
3634
+  (3.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
3635
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220161809')
3636
+ ActiveRecord::SchemaMigration Load (0.1ms) 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
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-01-25 00:00:00.000000000 Z
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.4.8
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.