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.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/README.md +28 -20
- data/VERSION +1 -1
- data/app/helpers/paid_up/features_helper.rb +3 -3
- data/app/models/paid_up/ability.rb +29 -11
- data/app/models/paid_up/feature.rb +70 -8
- data/app/models/paid_up/features_plan.rb +1 -2
- data/app/models/paid_up/plan.rb +9 -13
- data/app/models/paid_up/unlimited.rb +15 -0
- data/app/views/paid_up/features/_abilities_table.html.haml +13 -4
- data/app/views/paid_up/subscriptions/new.html.haml +20 -20
- data/bin/rails +8 -1
- data/config/locales/en.yml +4 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +291 -145
- data/db/migrate/20150407105900_create_paid_up_features_plans_table.rb +1 -1
- data/lib/generators/paid_up/install/install_generator.rb +6 -0
- data/lib/generators/paid_up/install/templates/initializer.rb +21 -1
- data/lib/paid_up/{integer.rb → extensions/integer.rb} +2 -4
- data/lib/paid_up/{stripe_extensions.rb → extensions/stripe.rb} +3 -6
- data/lib/paid_up/mixins/paid_for.rb +24 -0
- data/lib/paid_up/{mixins.rb → mixins/subscriber.rb} +28 -22
- data/lib/paid_up/validators/rolify_rows.rb +9 -0
- data/lib/paid_up/{table_validator.rb → validators/table_rows.rb} +2 -2
- data/lib/paid_up.rb +27 -7
- data/paid_up.gemspec +26 -16
- data/spec/dummy/app/models/ability.rb +0 -1
- data/spec/dummy/app/models/doodad.rb +3 -0
- data/spec/dummy/app/models/group.rb +1 -1
- data/spec/dummy/app/models/role.rb +10 -0
- data/spec/dummy/app/models/user.rb +2 -3
- data/spec/dummy/bin/rspec +3 -0
- data/spec/dummy/config/application.rb +0 -1
- data/spec/dummy/config/initializers/paid_up.rb +21 -1
- data/spec/dummy/config/initializers/rolify.rb +7 -0
- data/spec/dummy/config/routes.rb +10 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150517175135_create_groups_table.rb +0 -1
- data/spec/dummy/db/migrate/20150517175136_create_doodads_table.rb +9 -0
- data/spec/dummy/db/migrate/{20150518000915_add_devise_to_users.rb → 20150523010827_add_devise_to_users.rb} +0 -0
- data/spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb +19 -0
- 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
- 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
- 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
- data/spec/dummy/db/schema.rb +29 -15
- data/spec/dummy/db/seeds/features_plans.seeds.rb +9 -9
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +932 -108863
- data/spec/models/paid_up/feature_spec.rb +23 -5
- data/spec/models/paid_up/features_plan_spec.rb +2 -1
- data/spec/models/paid_up/plan_spec.rb +8 -32
- data/spec/models/user_spec.rb +110 -37
- data/spec/rails_helper.rb +1 -0
- data/spec/support/plans_and_features.rb +16 -62
- data/spec/views/paid_up/subscriptions_spec.rb +1 -1
- metadata +47 -15
- data/db/migrate/20150407110100_create_paid_up_features_table.rb +0 -11
- data/lib/paid_up/unlimited.rb +0 -17
- data/spec/dummy/db/migrate/20150518000918_create_paid_up_features_table.paid_up.rb +0 -12
- data/spec/dummy/db/seeds/features.seeds.rb +0 -19
- 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
|
data/lib/paid_up/unlimited.rb
DELETED
@@ -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
|
-
)
|