paid_up 0.13.3 → 0.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +1 -1
  3. data/VERSION +1 -1
  4. data/app/models/paid_up/plan.rb +5 -5
  5. data/db/migrate/20150407110101_create_paid_up_plans_table.rb +1 -1
  6. data/db/migrate/20150519164237_add_stripe_id_column_to_users.rb +1 -1
  7. data/db/migrate/20160207113800_create_paid_up_plan_feature_settings_table.rb +1 -1
  8. data/db/migrate/20160210165128_add_coupon_code_column_to_users.rb +1 -1
  9. data/paid_up.gemspec +4 -4
  10. data/spec/controllers/paid_up/plans_spec.rb +1 -1
  11. data/spec/controllers/paid_up/subscriptions_spec.rb +2 -2
  12. data/spec/dummy/config/application.rb +7 -0
  13. data/spec/dummy/db/migrate/20150406154440_create_users_table.rb +1 -1
  14. data/spec/dummy/db/migrate/20150517175135_create_groups_table.rb +1 -1
  15. data/spec/dummy/db/migrate/20150517175136_create_doodads_table.rb +1 -1
  16. data/spec/dummy/db/migrate/20150523010827_add_devise_to_users.rb +1 -1
  17. data/spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb +1 -1
  18. data/spec/dummy/db/migrate/20160207184112_create_paid_up_plans_table.paid_up.rb +1 -1
  19. data/spec/dummy/db/migrate/20160207184113_add_stripe_id_column_to_users.paid_up.rb +1 -1
  20. data/spec/dummy/db/migrate/20160207184114_create_paid_up_plan_feature_settings_table.paid_up.rb +1 -1
  21. data/spec/dummy/db/migrate/20160210165341_add_coupon_code_column_to_users.paid_up.rb +1 -1
  22. data/spec/dummy/db/migrate/20170219225950_create_posts_table.rb +1 -1
  23. data/spec/dummy/db/migrate/20170220001913_add_active_column_to_groups.rb +1 -1
  24. data/spec/dummy/db/schema.rb +36 -33
  25. data/spec/dummy/db/test.sqlite3 +0 -0
  26. data/spec/factories/user.rb +1 -1
  27. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a7ea560275e3137dfc8316eeb8768b985c55a9c5
4
- data.tar.gz: c2d093b99e53d8460787b3845ed0c64b0a0b0752
2
+ SHA256:
3
+ metadata.gz: ed5cbcfee4f51c5a6c8e56e5c21c9d9ec8d0a3f29e7392d4f3c01943d1c76978
4
+ data.tar.gz: 974b7d1cafd005f4e4169642243665e0a50e5216218d9d1bff54c55d581e51d9
5
5
  SHA512:
6
- metadata.gz: c7d54a790723c63cb3e0be5c6c2e9d8511c08c55425425e48dc1cbd40c4e944b7b1099665b13c4f029069c97ce3daf07ad6e0278830f7f402ba676b11648a9ef
7
- data.tar.gz: 87cf4f4d9d7bb9398f233036394ac43e28e6d1ebcffcc535ac8b6fd98fe17bebe5464a831b264c7e816c97f4783496ca154eada0233bf1780852568ea85efce1
6
+ metadata.gz: 6e555d71c53fe90e069565169d3f5ecaa6523504d9a810ac4657697e72237a9cb8f5a9c1f69d80c094136b96df0a3b2ebebc17f3a9e75cede55f3f0a2cc5631d
7
+ data.tar.gz: 3505b1f701f3b3c321ccbc72a6c295cf6400a827cf62b31c4480897173a957fa4a78ad6a5402eb3d98ac6c201080482fbc3e7d5b47e4ddf5d3b3cc0a003cb444
data/Gemfile CHANGED
@@ -44,7 +44,7 @@ group :test, :development do
44
44
  end
45
45
 
46
46
  group :test do
47
- gem 'capybara', '~> 2'
47
+ gem 'capybara', '>= 3', '< 4'
48
48
  gem 'coveralls', '>= 0.8', '< 2', require: false
49
49
  gem 'database_cleaner', '~> 1'
50
50
  gem 'launchy', '~> 2.4', require: false
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.13.3
1
+ 0.13.4
@@ -21,15 +21,15 @@ module PaidUp
21
21
 
22
22
  default_scope { order('sort_order ASC') }
23
23
  scope :subscribable, -> { where('sort_order >= ?', 0) }
24
- scope :within, ->(ids) { where(id: ids) }
25
- scope :without, ->(ids) { where.not(id: ids) }
24
+ scope :including, ->(ids) { where(id: ids) }
25
+ scope :excluding, ->(ids) { where.not(id: ids) }
26
26
  scope :free, (lambda do
27
27
  find_by_stripe_id(PaidUp.configuration.free_plan_stripe_id)
28
28
  end)
29
- scope :display, (lambda do |within, without|
29
+ scope :display, (lambda do |including, excluding|
30
30
  plans = subscribable
31
- plans = plans.within(within) if within.present?
32
- plans = plans.without(without) if without.present?
31
+ plans = plans.including(including) if including.present?
32
+ plans = plans.excluding(excluding) if excluding.present?
33
33
  plans
34
34
  end)
35
35
 
@@ -1,4 +1,4 @@
1
- class CreatePaidUpPlansTable < ActiveRecord::Migration
1
+ class CreatePaidUpPlansTable < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :paid_up_plans do |t|
4
4
  t.string :stripe_id
@@ -1,4 +1,4 @@
1
- class AddStripeIdColumnToUsers < ActiveRecord::Migration
1
+ class AddStripeIdColumnToUsers < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :users, :stripe_id, :string, index: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreatePaidUpPlanFeatureSettingsTable < ActiveRecord::Migration
1
+ class CreatePaidUpPlanFeatureSettingsTable < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :paid_up_plan_feature_settings do |t|
4
4
  t.references :paid_up_plan, index: true, foreign_key: true
@@ -1,4 +1,4 @@
1
- class AddCouponCodeColumnToUsers < ActiveRecord::Migration
1
+ class AddCouponCodeColumnToUsers < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :users, :coupon_code, :string
4
4
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: paid_up 0.13.3 ruby lib
5
+ # stub: paid_up 0.13.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "paid_up".freeze
9
- s.version = "0.13.3"
9
+ s.version = "0.13.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Karen Lundgren".freeze]
14
- s.date = "2017-12-21"
14
+ s.date = "2018-05-19"
15
15
  s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features.".freeze
16
16
  s.email = "karen.e.lundgren@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -177,7 +177,7 @@ Gem::Specification.new do |s|
177
177
  ]
178
178
  s.homepage = "http://www.gemvein.com/museum/cases/paid_up".freeze
179
179
  s.licenses = ["MIT".freeze]
180
- s.rubygems_version = "2.6.11".freeze
180
+ s.rubygems_version = "2.7.6".freeze
181
181
  s.summary = "Allows a model of your choosing to subscribe to a plan, which enables features.".freeze
182
182
 
183
183
  if s.respond_to? :specification_version then
@@ -12,7 +12,7 @@ RSpec.describe PaidUp::PlansController do
12
12
  end
13
13
  context 'responds successfully with an HTTP 200 status code' do
14
14
  subject { response }
15
- it { should be_success }
15
+ it { should be_successful }
16
16
  it { should have_http_status(200) }
17
17
  end
18
18
  context 'renders the index template' do
@@ -25,7 +25,7 @@ RSpec.describe PaidUp::SubscriptionsController do
25
25
  end
26
26
  describe 'responds successfully with an HTTP 200 status code' do
27
27
  subject { response }
28
- it { should be_success }
28
+ it { should be_successful }
29
29
  it { should have_http_status(200) }
30
30
  end
31
31
  describe 'renders the index template' do
@@ -59,7 +59,7 @@ RSpec.describe PaidUp::SubscriptionsController do
59
59
  end
60
60
  describe 'responds successfully with an HTTP 200 status code' do
61
61
  subject { response }
62
- it { should be_success }
62
+ it { should be_successful }
63
63
  it { should have_http_status(200) }
64
64
  end
65
65
  describe 'renders the new template' do
@@ -44,3 +44,10 @@ module Dummy
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ Rails
49
+ .application
50
+ .config
51
+ .active_record
52
+ .sqlite3
53
+ .represent_boolean_as_integer = true
@@ -1,4 +1,4 @@
1
- class CreateUsersTable < ActiveRecord::Migration
1
+ class CreateUsersTable < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :users do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateGroupsTable < ActiveRecord::Migration
1
+ class CreateGroupsTable < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :groups do |t|
4
4
  t.string :title
@@ -1,4 +1,4 @@
1
- class CreateDoodadsTable < ActiveRecord::Migration
1
+ class CreateDoodadsTable < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :doodads do |t|
4
4
  t.string :user_id, index: true
@@ -1,4 +1,4 @@
1
- class AddDeviseToUsers < ActiveRecord::Migration
1
+ class AddDeviseToUsers < ActiveRecord::Migration[5.2]
2
2
  def self.up
3
3
  change_table(:users) do |t|
4
4
  ## Database authenticatable
@@ -1,4 +1,4 @@
1
- class RolifyCreateRoles < ActiveRecord::Migration
1
+ class RolifyCreateRoles < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table(:roles) do |t|
4
4
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from paid_up (originally 20150407110101)
2
- class CreatePaidUpPlansTable < ActiveRecord::Migration
2
+ class CreatePaidUpPlansTable < ActiveRecord::Migration[5.2]
3
3
  def change
4
4
  create_table :paid_up_plans do |t|
5
5
  t.string :stripe_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from paid_up (originally 20150519164237)
2
- class AddStripeIdColumnToUsers < ActiveRecord::Migration
2
+ class AddStripeIdColumnToUsers < ActiveRecord::Migration[5.2]
3
3
  def change
4
4
  add_column :users, :stripe_id, :string, index: true
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from paid_up (originally 20160207113800)
2
- class CreatePaidUpPlanFeatureSettingsTable < ActiveRecord::Migration
2
+ class CreatePaidUpPlanFeatureSettingsTable < ActiveRecord::Migration[5.2]
3
3
  def change
4
4
  create_table :paid_up_plan_feature_settings do |t|
5
5
  t.references :paid_up_plan, index: true, foreign_key: true
@@ -1,5 +1,5 @@
1
1
  # This migration comes from paid_up (originally 20160210165128)
2
- class AddCouponCodeColumnToUsers < ActiveRecord::Migration
2
+ class AddCouponCodeColumnToUsers < ActiveRecord::Migration[5.2]
3
3
  def change
4
4
  add_column :users, :coupon_code, :string
5
5
  end
@@ -1,4 +1,4 @@
1
- class CreatePostsTable < ActiveRecord::Migration
1
+ class CreatePostsTable < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :posts do |t|
4
4
  t.string :user_id, index: true
@@ -1,4 +1,4 @@
1
- class AddActiveColumnToGroups < ActiveRecord::Migration
1
+ class AddActiveColumnToGroups < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :groups, :active, :boolean, null: false, default: false
4
4
  add_index :groups, :active
@@ -10,77 +10,78 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20170220001913) do
13
+ ActiveRecord::Schema.define(version: 2017_02_20_001913) do
14
14
 
15
15
  create_table "doodads", force: :cascade do |t|
16
16
  t.string "user_id"
17
17
  t.string "name"
18
- t.text "description"
18
+ t.text "description"
19
19
  t.index ["user_id"], name: "index_doodads_on_user_id"
20
20
  end
21
21
 
22
22
  create_table "groups", force: :cascade do |t|
23
- t.string "title"
24
- t.text "description"
25
- t.datetime "created_at"
26
- t.datetime "updated_at"
27
- t.boolean "active", default: false, null: false
23
+ t.string "title"
24
+ t.text "description"
25
+ t.datetime "created_at", null: false
26
+ t.datetime "updated_at", null: false
27
+ t.boolean "active", default: false, null: false
28
28
  t.index ["active"], name: "index_groups_on_active"
29
29
  end
30
30
 
31
31
  create_table "paid_up_plan_feature_settings", force: :cascade do |t|
32
32
  t.integer "paid_up_plan_id"
33
- t.string "feature"
33
+ t.string "feature"
34
34
  t.integer "setting"
35
35
  t.index ["feature"], name: "index_paid_up_plan_feature_settings_on_feature"
36
36
  t.index ["paid_up_plan_id"], name: "index_paid_up_plan_feature_settings_on_paid_up_plan_id"
37
37
  end
38
38
 
39
39
  create_table "paid_up_plans", force: :cascade do |t|
40
- t.string "stripe_id"
41
- t.string "title"
42
- t.text "description"
43
- t.integer "sort_order"
44
- t.datetime "created_at"
45
- t.datetime "updated_at"
40
+ t.string "stripe_id"
41
+ t.string "title"
42
+ t.text "description"
43
+ t.integer "sort_order"
44
+ t.datetime "created_at", null: false
45
+ t.datetime "updated_at", null: false
46
46
  t.index ["stripe_id"], name: "index_paid_up_plans_on_stripe_id", unique: true
47
47
  t.index ["title"], name: "index_paid_up_plans_on_title", unique: true
48
48
  end
49
49
 
50
50
  create_table "posts", force: :cascade do |t|
51
- t.string "user_id"
52
- t.string "title"
53
- t.boolean "active", default: false, null: false
54
- t.datetime "created_at"
55
- t.datetime "updated_at"
51
+ t.string "user_id"
52
+ t.string "title"
53
+ t.boolean "active", default: false, null: false
54
+ t.datetime "created_at", null: false
55
+ t.datetime "updated_at", null: false
56
56
  t.index ["active"], name: "index_posts_on_active"
57
57
  t.index ["user_id"], name: "index_posts_on_user_id"
58
58
  end
59
59
 
60
60
  create_table "roles", force: :cascade do |t|
61
- t.string "name"
62
- t.string "resource_type"
63
- t.integer "resource_id"
64
- t.datetime "created_at"
65
- t.datetime "updated_at"
61
+ t.string "name"
62
+ t.string "resource_type"
63
+ t.integer "resource_id"
64
+ t.datetime "created_at", null: false
65
+ t.datetime "updated_at", null: false
66
66
  t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
67
67
  t.index ["name"], name: "index_roles_on_name"
68
+ t.index ["resource_type", "resource_id"], name: "index_roles_on_resource_type_and_resource_id"
68
69
  end
69
70
 
70
71
  create_table "users", force: :cascade do |t|
71
- t.string "name"
72
- t.string "email", default: "", null: false
73
- t.string "encrypted_password", default: "", null: false
74
- t.string "reset_password_token"
72
+ t.string "name"
73
+ t.string "email", default: "", null: false
74
+ t.string "encrypted_password", default: "", null: false
75
+ t.string "reset_password_token"
75
76
  t.datetime "reset_password_sent_at"
76
77
  t.datetime "remember_created_at"
77
- t.integer "sign_in_count", default: 0, null: false
78
+ t.integer "sign_in_count", default: 0, null: false
78
79
  t.datetime "current_sign_in_at"
79
80
  t.datetime "last_sign_in_at"
80
- t.string "current_sign_in_ip"
81
- t.string "last_sign_in_ip"
82
- t.string "stripe_id"
83
- t.string "coupon_code"
81
+ t.string "current_sign_in_ip"
82
+ t.string "last_sign_in_ip"
83
+ t.string "stripe_id"
84
+ t.string "coupon_code"
84
85
  t.index ["email"], name: "index_users_on_email", unique: true
85
86
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
86
87
  end
@@ -88,7 +89,9 @@ ActiveRecord::Schema.define(version: 20170220001913) do
88
89
  create_table "users_roles", id: false, force: :cascade do |t|
89
90
  t.integer "user_id"
90
91
  t.integer "role_id"
92
+ t.index ["role_id"], name: "index_users_roles_on_role_id"
91
93
  t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
94
+ t.index ["user_id"], name: "index_users_roles_on_user_id"
92
95
  end
93
96
 
94
97
  end
Binary file
@@ -8,7 +8,7 @@ FactoryBot.define do
8
8
  password 'password'
9
9
  password_confirmation 'password'
10
10
  transient do
11
- plan { PaidUp::Plan.order('RANDOM()').first }
11
+ plan { PaidUp::Plan.all.sample }
12
12
  past_due false
13
13
  end
14
14
  # the after(:create) yields two values; the user instance itself and the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paid_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-21 00:00:00.000000000 Z
11
+ date: 2018-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml-rails
@@ -664,7 +664,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
664
664
  version: '0'
665
665
  requirements: []
666
666
  rubyforge_project:
667
- rubygems_version: 2.6.11
667
+ rubygems_version: 2.7.6
668
668
  signing_key:
669
669
  specification_version: 4
670
670
  summary: Allows a model of your choosing to subscribe to a plan, which enables features.