paid_up 0.2.4 → 0.3.0

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/README.md +28 -20
  4. data/VERSION +1 -1
  5. data/app/helpers/paid_up/features_helper.rb +3 -3
  6. data/app/models/paid_up/ability.rb +29 -11
  7. data/app/models/paid_up/feature.rb +70 -8
  8. data/app/models/paid_up/features_plan.rb +1 -2
  9. data/app/models/paid_up/plan.rb +9 -13
  10. data/app/models/paid_up/unlimited.rb +15 -0
  11. data/app/views/paid_up/features/_abilities_table.html.haml +13 -4
  12. data/app/views/paid_up/subscriptions/new.html.haml +20 -20
  13. data/bin/rails +8 -1
  14. data/config/locales/en.yml +4 -1
  15. data/coverage/.last_run.json +1 -1
  16. data/coverage/.resultset.json +291 -145
  17. data/db/migrate/20150407105900_create_paid_up_features_plans_table.rb +1 -1
  18. data/lib/generators/paid_up/install/install_generator.rb +6 -0
  19. data/lib/generators/paid_up/install/templates/initializer.rb +21 -1
  20. data/lib/paid_up/{integer.rb → extensions/integer.rb} +2 -4
  21. data/lib/paid_up/{stripe_extensions.rb → extensions/stripe.rb} +3 -6
  22. data/lib/paid_up/mixins/paid_for.rb +24 -0
  23. data/lib/paid_up/{mixins.rb → mixins/subscriber.rb} +28 -22
  24. data/lib/paid_up/validators/rolify_rows.rb +9 -0
  25. data/lib/paid_up/{table_validator.rb → validators/table_rows.rb} +2 -2
  26. data/lib/paid_up.rb +27 -7
  27. data/paid_up.gemspec +26 -16
  28. data/spec/dummy/app/models/ability.rb +0 -1
  29. data/spec/dummy/app/models/doodad.rb +3 -0
  30. data/spec/dummy/app/models/group.rb +1 -1
  31. data/spec/dummy/app/models/role.rb +10 -0
  32. data/spec/dummy/app/models/user.rb +2 -3
  33. data/spec/dummy/bin/rspec +3 -0
  34. data/spec/dummy/config/application.rb +0 -1
  35. data/spec/dummy/config/initializers/paid_up.rb +21 -1
  36. data/spec/dummy/config/initializers/rolify.rb +7 -0
  37. data/spec/dummy/config/routes.rb +10 -0
  38. data/spec/dummy/db/development.sqlite3 +0 -0
  39. data/spec/dummy/db/migrate/20150517175135_create_groups_table.rb +0 -1
  40. data/spec/dummy/db/migrate/20150517175136_create_doodads_table.rb +9 -0
  41. data/spec/dummy/db/migrate/{20150518000915_add_devise_to_users.rb → 20150523010827_add_devise_to_users.rb} +0 -0
  42. data/spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb +19 -0
  43. data/spec/dummy/db/migrate/{20150518000917_create_paid_up_features_plans_table.paid_up.rb → 20150523010838_create_paid_up_features_plans_table.paid_up.rb} +1 -1
  44. data/spec/dummy/db/migrate/{20150518000919_create_paid_up_plans_table.paid_up.rb → 20150523010839_create_paid_up_plans_table.paid_up.rb} +0 -0
  45. data/spec/dummy/db/migrate/{20150519164355_add_stripe_id_column_to_users.paid_up.rb → 20150523010840_add_stripe_id_column_to_users.paid_up.rb} +0 -0
  46. data/spec/dummy/db/schema.rb +29 -15
  47. data/spec/dummy/db/seeds/features_plans.seeds.rb +9 -9
  48. data/spec/dummy/db/test.sqlite3 +0 -0
  49. data/spec/dummy/log/development.log +932 -108863
  50. data/spec/models/paid_up/feature_spec.rb +23 -5
  51. data/spec/models/paid_up/features_plan_spec.rb +2 -1
  52. data/spec/models/paid_up/plan_spec.rb +8 -32
  53. data/spec/models/user_spec.rb +110 -37
  54. data/spec/rails_helper.rb +1 -0
  55. data/spec/support/plans_and_features.rb +16 -62
  56. data/spec/views/paid_up/subscriptions_spec.rb +1 -1
  57. metadata +47 -15
  58. data/db/migrate/20150407110100_create_paid_up_features_table.rb +0 -11
  59. data/lib/paid_up/unlimited.rb +0 -17
  60. data/spec/dummy/db/migrate/20150518000918_create_paid_up_features_table.paid_up.rb +0 -12
  61. data/spec/dummy/db/seeds/features.seeds.rb +0 -19
  62. data/spec/dummy/test/controllers/plans_controller_controller_test.rb +0 -7
@@ -1,11 +0,0 @@
1
- class CreatePaidUpFeaturesTable < ActiveRecord::Migration
2
- def change
3
- create_table :paid_up_features do |t|
4
- t.string :name
5
- t.string :title
6
- t.string :setting_type
7
- t.text :description
8
- end
9
- add_index :paid_up_features, :name, :unique => true
10
- end
11
- end
@@ -1,17 +0,0 @@
1
- module PaidUp
2
- module Unlimited
3
- def self.initialize
4
- 999999999
5
- end
6
- def self.to_i(format = :default)
7
- if format == :db
8
- -1
9
- else
10
- 999999999
11
- end
12
- end
13
- def self.to_s
14
- :unlimited.l
15
- end
16
- end
17
- end
@@ -1,12 +0,0 @@
1
- # This migration comes from paid_up (originally 20150407110100)
2
- class CreatePaidUpFeaturesTable < ActiveRecord::Migration
3
- def change
4
- create_table :paid_up_features do |t|
5
- t.string :name
6
- t.string :title
7
- t.string :setting_type
8
- t.text :description
9
- end
10
- add_index :paid_up_features, :name, :unique => true
11
- end
12
- end
@@ -1,19 +0,0 @@
1
- PaidUp::Feature.create(
2
- name: 'ad_free',
3
- title: 'Ad Free',
4
- description: 'Are ads removed from the site with this plan?',
5
- setting_type: 'boolean'
6
- )
7
- PaidUp::Feature.create(
8
- name: 'groups',
9
- title: 'Groups',
10
- description: 'How many groups are allowed with this plan?',
11
- setting_type: 'table_rows' # Enables table row counting that is enabled by a positive value
12
- # for the PaidUp::FeaturesPlan.setting associated with this PaidUp::Feature
13
- )
14
- PaidUp::Feature.create(
15
- name: 'calendar',
16
- title: 'Calendar',
17
- description: 'Is an event calendar included with this plan?',
18
- setting_type: 'boolean'
19
- )
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PlansControllerControllerTest < ActionController::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end