paid_up 0.13.3 → 0.13.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/app/models/paid_up/plan.rb +5 -5
- data/db/migrate/20150407110101_create_paid_up_plans_table.rb +1 -1
- data/db/migrate/20150519164237_add_stripe_id_column_to_users.rb +1 -1
- data/db/migrate/20160207113800_create_paid_up_plan_feature_settings_table.rb +1 -1
- data/db/migrate/20160210165128_add_coupon_code_column_to_users.rb +1 -1
- data/paid_up.gemspec +4 -4
- data/spec/controllers/paid_up/plans_spec.rb +1 -1
- data/spec/controllers/paid_up/subscriptions_spec.rb +2 -2
- data/spec/dummy/config/application.rb +7 -0
- data/spec/dummy/db/migrate/20150406154440_create_users_table.rb +1 -1
- data/spec/dummy/db/migrate/20150517175135_create_groups_table.rb +1 -1
- data/spec/dummy/db/migrate/20150517175136_create_doodads_table.rb +1 -1
- data/spec/dummy/db/migrate/20150523010827_add_devise_to_users.rb +1 -1
- data/spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb +1 -1
- data/spec/dummy/db/migrate/20160207184112_create_paid_up_plans_table.paid_up.rb +1 -1
- data/spec/dummy/db/migrate/20160207184113_add_stripe_id_column_to_users.paid_up.rb +1 -1
- data/spec/dummy/db/migrate/20160207184114_create_paid_up_plan_feature_settings_table.paid_up.rb +1 -1
- data/spec/dummy/db/migrate/20160210165341_add_coupon_code_column_to_users.paid_up.rb +1 -1
- data/spec/dummy/db/migrate/20170219225950_create_posts_table.rb +1 -1
- data/spec/dummy/db/migrate/20170220001913_add_active_column_to_groups.rb +1 -1
- data/spec/dummy/db/schema.rb +36 -33
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/user.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ed5cbcfee4f51c5a6c8e56e5c21c9d9ec8d0a3f29e7392d4f3c01943d1c76978
|
4
|
+
data.tar.gz: 974b7d1cafd005f4e4169642243665e0a50e5216218d9d1bff54c55d581e51d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e555d71c53fe90e069565169d3f5ecaa6523504d9a810ac4657697e72237a9cb8f5a9c1f69d80c094136b96df0a3b2ebebc17f3a9e75cede55f3f0a2cc5631d
|
7
|
+
data.tar.gz: 3505b1f701f3b3c321ccbc72a6c295cf6400a827cf62b31c4480897173a957fa4a78ad6a5402eb3d98ac6c201080482fbc3e7d5b47e4ddf5d3b3cc0a003cb444
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.13.
|
1
|
+
0.13.4
|
data/app/models/paid_up/plan.rb
CHANGED
@@ -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 :
|
25
|
-
scope :
|
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 |
|
29
|
+
scope :display, (lambda do |including, excluding|
|
30
30
|
plans = subscribable
|
31
|
-
plans = plans.
|
32
|
-
plans = plans.
|
31
|
+
plans = plans.including(including) if including.present?
|
32
|
+
plans = plans.excluding(excluding) if excluding.present?
|
33
33
|
plans
|
34
34
|
end)
|
35
35
|
|
data/paid_up.gemspec
CHANGED
@@ -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.
|
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.
|
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 = "
|
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
|
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
|
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
|
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
|
62
|
+
it { should be_successful }
|
63
63
|
it { should have_http_status(200) }
|
64
64
|
end
|
65
65
|
describe 'renders the new template' do
|
data/spec/dummy/db/migrate/20160207184114_create_paid_up_plan_feature_settings_table.paid_up.rb
CHANGED
@@ -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
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -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:
|
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
|
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
|
24
|
-
t.text
|
25
|
-
t.datetime "created_at"
|
26
|
-
t.datetime "updated_at"
|
27
|
-
t.boolean
|
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
|
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
|
41
|
-
t.string
|
42
|
-
t.text
|
43
|
-
t.integer
|
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
|
52
|
-
t.string
|
53
|
-
t.boolean
|
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
|
62
|
-
t.string
|
63
|
-
t.integer
|
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
|
72
|
-
t.string
|
73
|
-
t.string
|
74
|
-
t.string
|
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
|
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
|
81
|
-
t.string
|
82
|
-
t.string
|
83
|
-
t.string
|
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
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/factories/user.rb
CHANGED
@@ -8,7 +8,7 @@ FactoryBot.define do
|
|
8
8
|
password 'password'
|
9
9
|
password_confirmation 'password'
|
10
10
|
transient do
|
11
|
-
plan { PaidUp::Plan.
|
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.
|
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:
|
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
|
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.
|