paid_up 0.7.5 → 0.7.6
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/models/paid_up/ability.rb +7 -3
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1430 -33
- data/lib/paid_up/engine.rb +9 -4
- data/lib/paid_up/mixins/paid_for.rb +1 -1
- data/paid_up.gemspec +13 -5
- data/spec/controllers/paid_up/plans_spec.rb +2 -2
- data/spec/controllers/paid_up/subscriptions_spec.rb +25 -46
- data/spec/dummy/config/application.rb +12 -0
- data/spec/dummy/coverage/.last_run.json +5 -0
- data/spec/dummy/coverage/.resultset.json +155 -0
- data/spec/dummy/coverage/.resultset.json.lock +0 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/seeds.rb +88 -14
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +2281 -0
- data/spec/factories/group.rb +10 -0
- data/spec/factories/user.rb +19 -1
- data/spec/models/group_spec.rb +5 -5
- data/spec/models/paid_up/feature_spec.rb +2 -1
- data/spec/models/paid_up/plan_spec.rb +3 -2
- data/spec/models/user_spec.rb +47 -32
- data/spec/rails_helper.rb +18 -1
- data/spec/routing/paid_up/plans_spec.rb +1 -1
- data/spec/routing/paid_up/subscription_spec.rb +1 -1
- data/spec/support/features.rb +5 -0
- data/spec/support/groups.rb +4 -32
- data/spec/support/loaded_site.rb +7 -0
- data/spec/support/plans.rb +7 -0
- data/spec/support/users.rb +8 -0
- data/spec/views/paid_up/plans_spec.rb +1 -2
- data/spec/views/paid_up/subscriptions_spec.rb +2 -3
- metadata +23 -4
- data/spec/support/plans_and_features.rb +0 -163
- data/spec/support/subscribers.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6f9d54cbdb0e8672defd4e9b8de158c51b46d08
|
4
|
+
data.tar.gz: 1e0e476f7137ee3e1b0ef0d45e7a2adc556609f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d35a8549bc4bd499b2ee1d8ffb1909face0ff4f923572fe317f55fd4572af50659cb9c37388915adb5b0313f4f5a764a6a27648f5893c93df235a35459f337e
|
7
|
+
data.tar.gz: 7353dad8379aacda1813581466984c562fa921326db4bae0a403148181f7f18a3c5d471f4cff4e16c0dab6474cac6e722aeb93dfe36636db472c2fec586969d4
|
data/Gemfile
CHANGED
@@ -24,6 +24,7 @@ group :test, :development do
|
|
24
24
|
gem 'sass-rails', '~> 5.0'
|
25
25
|
gem 'high_voltage', '~> 2.3'
|
26
26
|
gem 'rspec-rails', '~> 3.2'
|
27
|
+
gem 'factory_girl_rails', '~> 4.5'
|
27
28
|
end
|
28
29
|
|
29
30
|
group :test do
|
@@ -33,7 +34,6 @@ group :test do
|
|
33
34
|
gem 'shoulda-matchers', '~> 2.8'
|
34
35
|
gem 'minitest', '~>5.5.1'
|
35
36
|
gem "launchy", "~> 2.1.2", require: false
|
36
|
-
gem 'factory_girl_rails', '~> 4.5', require: false
|
37
37
|
gem 'coveralls', '~> 0.8', require: false
|
38
38
|
end
|
39
39
|
|
data/README.md
CHANGED
@@ -63,7 +63,7 @@ In order for PaidUp's AJAX functionality to work (which is required because Stri
|
|
63
63
|
|
64
64
|
## Abilities
|
65
65
|
|
66
|
-
Abilities corresponding to features you have defined will be generated automatically, as an `:own` ability on the specified tables, plus rational defaults for `:manage` and `:
|
66
|
+
Abilities corresponding to features you have defined will be generated automatically, as an `:own` ability on the specified tables, plus rational defaults for `:manage`, `:index` and `:show` permissions, if you include the `PaidUp::Ability` module and use the `initialize_paid_up(user)` command, like this:
|
67
67
|
|
68
68
|
# /app/models/ability.rb
|
69
69
|
class Ability
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.6
|
@@ -8,7 +8,9 @@ module PaidUp
|
|
8
8
|
case feature.setting_type
|
9
9
|
when 'table_rows'
|
10
10
|
can :index, feature.feature_model
|
11
|
-
can :show, feature.feature_model
|
11
|
+
can :show, feature.feature_model do |item|
|
12
|
+
item.enabled
|
13
|
+
end
|
12
14
|
if user.table_rows_allowed(feature.slug) > 0 || user.table_rows_unlimited?(feature.slug)
|
13
15
|
can :manage, feature.feature_model, :user => user
|
14
16
|
can :own, feature.feature_model
|
@@ -25,9 +27,11 @@ module PaidUp
|
|
25
27
|
end
|
26
28
|
when 'rolify_rows'
|
27
29
|
can :index, feature.feature_model
|
28
|
-
can :show, feature.feature_model
|
30
|
+
can :show, feature.feature_model do |item|
|
31
|
+
item.enabled
|
32
|
+
end
|
29
33
|
if user.rolify_rows_allowed(feature.slug) > 0 || user.rolify_rows_unlimited?(feature.slug)
|
30
|
-
can :manage, feature.feature_model, id:
|
34
|
+
can :manage, feature.feature_model, id: feature.feature_model.with_role(:owner, user).pluck(:id)
|
31
35
|
can :own, feature.feature_model
|
32
36
|
if user.rolify_rows_remaining(feature.slug) > 0
|
33
37
|
can [:create, :new], feature.feature_model
|
data/coverage/.last_run.json
CHANGED