paid_up 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +1 -1
  4. data/VERSION +1 -1
  5. data/app/models/paid_up/ability.rb +7 -3
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +1430 -33
  8. data/lib/paid_up/engine.rb +9 -4
  9. data/lib/paid_up/mixins/paid_for.rb +1 -1
  10. data/paid_up.gemspec +13 -5
  11. data/spec/controllers/paid_up/plans_spec.rb +2 -2
  12. data/spec/controllers/paid_up/subscriptions_spec.rb +25 -46
  13. data/spec/dummy/config/application.rb +12 -0
  14. data/spec/dummy/coverage/.last_run.json +5 -0
  15. data/spec/dummy/coverage/.resultset.json +155 -0
  16. data/spec/dummy/coverage/.resultset.json.lock +0 -0
  17. data/spec/dummy/db/development.sqlite3 +0 -0
  18. data/spec/dummy/db/seeds.rb +88 -14
  19. data/spec/dummy/db/test.sqlite3 +0 -0
  20. data/spec/dummy/log/development.log +2281 -0
  21. data/spec/factories/group.rb +10 -0
  22. data/spec/factories/user.rb +19 -1
  23. data/spec/models/group_spec.rb +5 -5
  24. data/spec/models/paid_up/feature_spec.rb +2 -1
  25. data/spec/models/paid_up/plan_spec.rb +3 -2
  26. data/spec/models/user_spec.rb +47 -32
  27. data/spec/rails_helper.rb +18 -1
  28. data/spec/routing/paid_up/plans_spec.rb +1 -1
  29. data/spec/routing/paid_up/subscription_spec.rb +1 -1
  30. data/spec/support/features.rb +5 -0
  31. data/spec/support/groups.rb +4 -32
  32. data/spec/support/loaded_site.rb +7 -0
  33. data/spec/support/plans.rb +7 -0
  34. data/spec/support/users.rb +8 -0
  35. data/spec/views/paid_up/plans_spec.rb +1 -2
  36. data/spec/views/paid_up/subscriptions_spec.rb +2 -3
  37. metadata +23 -4
  38. data/spec/support/plans_and_features.rb +0 -163
  39. data/spec/support/subscribers.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 498d651e8152a88cda7207664b4bc9040e84eabb
4
- data.tar.gz: b297ee993fc77dc187e4e31524effdfd5812d0ee
3
+ metadata.gz: a6f9d54cbdb0e8672defd4e9b8de158c51b46d08
4
+ data.tar.gz: 1e0e476f7137ee3e1b0ef0d45e7a2adc556609f0
5
5
  SHA512:
6
- metadata.gz: fb2a7fe637ea08c8c283ed1acb17cf4060a7173b2a6b44e630dcb7ca3428e634657cd254dbb56b664ec777f28cc24f3c5f8e7c2a3d21fae26f32cc370a269d38
7
- data.tar.gz: f19eb5fb5e96b1521c3318d05c72f0b1fbc3947c661b34fa66571fd2bc78e39415261ceb78f9a39f207808e16473ca657791959a25e4c9c1ee117c08d4050f1a
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 `:read` permissions, if you include the `PaidUp::Ability` module and use the `initialize_paid_up(user)` command, like this:
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.5
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, enabled: true
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, enabled: true
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: Group.with_role(:owner, user).pluck(: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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 41.8
3
+ "covered_percent": 84.78
4
4
  }
5
5
  }