paid_up 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- class CreatePaidUpFeaturesPlansTable < ActiveRecord::Migration
1
+ class CreatePaidUpPlanFeatureSettingsTable < ActiveRecord::Migration
2
2
  def change
3
- create_table :paid_up_features_plans do |t|
3
+ create_table :paid_up_plan_feature_settings do |t|
4
4
  t.references :plan, index: true, foreign_key: true
5
5
  t.string :feature, index: true, foreign_key: true
6
6
  t.integer :setting
@@ -15,7 +15,7 @@ PaidUp::Feature.new(
15
15
  title: 'Groups',
16
16
  description: 'How many groups are allowed with this plan?',
17
17
  setting_type: 'table_rows' # Enables table row counting that is enabled by a positive value
18
- # for the PaidUp::FeaturesPlan.setting associated with this PaidUp::Feature
18
+ # for the PaidUp::PlanFeatureSetting.setting associated with this PaidUp::Feature
19
19
  )
20
20
  PaidUp::Feature.new(
21
21
  slug: 'doodads',
data/paid_up.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: paid_up 0.3.0 ruby lib
5
+ # stub: paid_up 0.4.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "paid_up"
9
- s.version = "0.3.0"
9
+ s.version = "0.4.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Karen Lundgren"]
14
- s.date = "2015-05-24"
14
+ s.date = "2015-05-25"
15
15
  s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features."
16
16
  s.email = "karen.e.lundgren@gmail.com"
17
17
  s.executables = ["rails"]
@@ -37,8 +37,8 @@ Gem::Specification.new do |s|
37
37
  "app/helpers/paid_up/subscriptions_helper.rb",
38
38
  "app/models/paid_up/ability.rb",
39
39
  "app/models/paid_up/feature.rb",
40
- "app/models/paid_up/features_plan.rb",
41
40
  "app/models/paid_up/plan.rb",
41
+ "app/models/paid_up/plan_feature_setting.rb",
42
42
  "app/models/paid_up/unlimited.rb",
43
43
  "app/views/devise/confirmations/new.html.haml",
44
44
  "app/views/devise/passwords/edit.html.haml",
@@ -62,7 +62,7 @@ Gem::Specification.new do |s|
62
62
  "coverage/.last_run.json",
63
63
  "coverage/.resultset.json",
64
64
  "coverage/.resultset.json.lock",
65
- "db/migrate/20150407105900_create_paid_up_features_plans_table.rb",
65
+ "db/migrate/20150407105900_create_paid_up_plan_feature_settings_table.rb",
66
66
  "db/migrate/20150407110101_create_paid_up_plans_table.rb",
67
67
  "db/migrate/20150519164237_add_stripe_id_column_to_users.rb",
68
68
  "lib/generators/paid_up/install/install_generator.rb",
@@ -130,12 +130,12 @@ Gem::Specification.new do |s|
130
130
  "spec/dummy/db/migrate/20150517175136_create_doodads_table.rb",
131
131
  "spec/dummy/db/migrate/20150523010827_add_devise_to_users.rb",
132
132
  "spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb",
133
- "spec/dummy/db/migrate/20150523010838_create_paid_up_features_plans_table.paid_up.rb",
133
+ "spec/dummy/db/migrate/20150523010838_create_paid_up_plan_feature_settings_table.paid_up.rb",
134
134
  "spec/dummy/db/migrate/20150523010839_create_paid_up_plans_table.paid_up.rb",
135
135
  "spec/dummy/db/migrate/20150523010840_add_stripe_id_column_to_users.paid_up.rb",
136
136
  "spec/dummy/db/schema.rb",
137
137
  "spec/dummy/db/seeds.rb",
138
- "spec/dummy/db/seeds/features_plans.seeds.rb",
138
+ "spec/dummy/db/seeds/plan_feature_settings.seeds.rb",
139
139
  "spec/dummy/db/seeds/plans.seeds.rb",
140
140
  "spec/dummy/db/test.sqlite3",
141
141
  "spec/dummy/lib/assets/.keep",
@@ -154,11 +154,11 @@ Gem::Specification.new do |s|
154
154
  "spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff2",
155
155
  "spec/dummy/public/favicon.ico",
156
156
  "spec/factories/feature.rb",
157
- "spec/factories/features_plan.rb",
158
157
  "spec/factories/plan.rb",
158
+ "spec/factories/plan_feature_setting.rb",
159
159
  "spec/factories/user.rb",
160
160
  "spec/models/paid_up/feature_spec.rb",
161
- "spec/models/paid_up/features_plan_spec.rb",
161
+ "spec/models/paid_up/plan_feature_setting_spec.rb",
162
162
  "spec/models/paid_up/plan_spec.rb",
163
163
  "spec/models/user_spec.rb",
164
164
  "spec/paid_up_spec.rb",
@@ -15,7 +15,7 @@ PaidUp::Feature.new(
15
15
  title: 'Groups',
16
16
  description: 'How many groups are allowed with this plan?',
17
17
  setting_type: 'rolify_rows' # Enables table row counting that is enabled by a positive value
18
- # for the PaidUp::FeaturesPlan.setting associated with this PaidUp::Feature
18
+ # for the PaidUp::PlanFeatureSetting.setting associated with this PaidUp::Feature
19
19
  )
20
20
  PaidUp::Feature.new(
21
21
  slug: 'doodads',
Binary file
@@ -1,7 +1,7 @@
1
1
  # This migration comes from paid_up (originally 20150407105900)
2
- class CreatePaidUpFeaturesPlansTable < ActiveRecord::Migration
2
+ class CreatePaidUpPlanFeatureSettingsTable < ActiveRecord::Migration
3
3
  def change
4
- create_table :paid_up_features_plans do |t|
4
+ create_table :paid_up_plan_feature_settings do |t|
5
5
  t.references :plan, index: true, foreign_key: true
6
6
  t.string :feature, index: true, foreign_key: true
7
7
  t.integer :setting
@@ -28,14 +28,14 @@ ActiveRecord::Schema.define(version: 20150523010840) do
28
28
  t.datetime "updated_at"
29
29
  end
30
30
 
31
- create_table "paid_up_features_plans", force: :cascade do |t|
31
+ create_table "paid_up_plan_feature_settings", force: :cascade do |t|
32
32
  t.integer "plan_id"
33
33
  t.string "feature"
34
34
  t.integer "setting"
35
35
  end
36
36
 
37
- add_index "paid_up_features_plans", ["feature"], name: "index_paid_up_features_plans_on_feature"
38
- add_index "paid_up_features_plans", ["plan_id"], name: "index_paid_up_features_plans_on_plan_id"
37
+ add_index "paid_up_plan_feature_settings", ["feature"], name: "index_paid_up_plan_feature_settings_on_feature"
38
+ add_index "paid_up_plan_feature_settings", ["plan_id"], name: "index_paid_up_plan_feature_settings_on_plan_id"
39
39
 
40
40
  create_table "paid_up_plans", force: :cascade do |t|
41
41
  t.string "stripe_id"
@@ -1,50 +1,46 @@
1
1
  after :plans do
2
- ad_free = PaidUp::Feature.find_by_slug 'ad_free'
3
- groups = PaidUp::Feature.find_by_slug 'groups'
4
- doodads = PaidUp::Feature.find_by_slug 'doodads'
5
-
6
2
  free = PaidUp::Plan.find_by_name 'Free'
7
3
  no_ads = PaidUp::Plan.find_by_name 'No Ads'
8
4
  group_leader = PaidUp::Plan.find_by_name 'Group Leader'
9
5
  professional = PaidUp::Plan.find_by_name 'Professional'
10
6
 
11
7
  # Ad Free
12
- PaidUp::FeaturesPlan.create(
13
- feature: ad_free,
8
+ PaidUp::PlanFeatureSetting.create(
9
+ feature: 'ad_free',
14
10
  plan: no_ads,
15
11
  setting: 1
16
12
  )
17
13
 
18
14
  # Group Leader
19
- PaidUp::FeaturesPlan.create(
20
- feature: ad_free,
15
+ PaidUp::PlanFeatureSetting.create(
16
+ feature: 'ad_free',
21
17
  plan: group_leader,
22
18
  setting: 1
23
19
  )
24
- PaidUp::FeaturesPlan.create(
25
- feature: groups,
20
+ PaidUp::PlanFeatureSetting.create(
21
+ feature: 'groups',
26
22
  plan: group_leader,
27
23
  setting: 1
28
24
  )
29
- PaidUp::FeaturesPlan.create(
30
- feature: doodads,
25
+ PaidUp::PlanFeatureSetting.create(
26
+ feature: 'doodads',
31
27
  plan: group_leader,
32
28
  setting: 5
33
29
  )
34
30
 
35
31
  # Professional
36
- PaidUp::FeaturesPlan.create(
37
- feature: ad_free,
32
+ PaidUp::PlanFeatureSetting.create(
33
+ feature: 'ad_free',
38
34
  plan: professional,
39
35
  setting: 1
40
36
  )
41
- PaidUp::FeaturesPlan.create(
42
- feature: groups,
37
+ PaidUp::PlanFeatureSetting.create(
38
+ feature: 'groups',
43
39
  plan: professional,
44
40
  setting: PaidUp::Unlimited.to_i(:db)
45
41
  )
46
- PaidUp::FeaturesPlan.create(
47
- feature: doodads,
42
+ PaidUp::PlanFeatureSetting.create(
43
+ feature: 'doodads',
48
44
  plan: professional,
49
45
  setting: PaidUp::Unlimited.to_i(:db)
50
46
  )
Binary file