paid_up 0.5.3 → 0.6.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/VERSION +1 -1
- data/app/controllers/paid_up/subscriptions_controller.rb +2 -2
- data/app/models/paid_up/plan.rb +2 -3
- data/app/models/paid_up/plan_feature_setting.rb +1 -1
- data/app/views/paid_up/features/_table.html.haml +1 -1
- data/app/views/paid_up/plans/index.html.haml +2 -2
- data/app/views/paid_up/subscriptions/index.html.haml +1 -1
- data/app/views/paid_up/subscriptions/new.html.haml +1 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1275 -207
- data/db/migrate/20150407110101_create_paid_up_plans_table.rb +2 -2
- data/paid_up.gemspec +7 -3
- data/spec/controllers/paid_up/subscriptions_spec.rb +4 -4
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150523010839_create_paid_up_plans_table.paid_up.rb +2 -2
- data/spec/dummy/db/schema.rb +2 -2
- data/spec/dummy/db/seeds.rb +5 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1049 -0
- data/spec/support/plans_and_features.rb +5 -5
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 335fab8dafdbcbe809d161bb38022878df8db297
|
4
|
+
data.tar.gz: a9b3666398fdc7294d684cc0eaf8dc6ad2004aec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 005b35eed037a4782e448a36b059d09e23be1cf8ce641f8814ae0727e368e5a3a490267691a377b07a1cbe0fb92c324ae2832999dc10cedd9ed1ef8f5a7f7db6
|
7
|
+
data.tar.gz: 3996a7ea5cc9658a376d2e3f64fedaff54ae56fe91f6780a7399179c0e7a5d9448d785f5e46a7c7e202d0cbac2a1003fa1d3988f57c5b798d0cdb0656ee40971
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -17,9 +17,9 @@ module PaidUp
|
|
17
17
|
def create
|
18
18
|
# @plan set by #set_plan
|
19
19
|
if current_user.subscribe_to_plan(@plan, params[:stripeToken])
|
20
|
-
redirect_to subscriptions_path, flash: { notice: :you_are_now_subscribed_to_the_plan.l(plan_name: current_user.plan.
|
20
|
+
redirect_to subscriptions_path, flash: { notice: :you_are_now_subscribed_to_the_plan.l(plan_name: current_user.plan.title) }
|
21
21
|
else
|
22
|
-
redirect_to new_plan_subscription_path @plan, flash: { error: current_user.errors.full_messages || :could_not_subscribe_to_plan.l(plan: @plan.
|
22
|
+
redirect_to new_plan_subscription_path @plan, flash: { error: current_user.errors.full_messages || :could_not_subscribe_to_plan.l(plan: @plan.title) }
|
23
23
|
end
|
24
24
|
rescue Stripe::InvalidRequestError => e
|
25
25
|
flash[:error] = e.message
|
data/app/models/paid_up/plan.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
class PaidUp::Plan < ActiveRecord::Base
|
2
|
-
has_many :plan_feature_settings, class_name: 'PaidUp::PlanFeatureSetting'
|
3
|
-
has_many :subscribers, :through => :subscriptions, :source => :subscriber, :source_type => 'User'
|
2
|
+
has_many :plan_feature_settings, class_name: 'PaidUp::PlanFeatureSetting', foreign_key: 'plan_id', inverse_of: :plan
|
4
3
|
|
5
4
|
after_initialize :load_stripe_data
|
6
5
|
|
7
6
|
attr_accessor :stripe_data
|
8
7
|
|
9
|
-
validates_presence_of :
|
8
|
+
validates_presence_of :title, :stripe_id
|
10
9
|
|
11
10
|
default_scope { order('sort_order ASC') }
|
12
11
|
scope :subscribable, -> { where('sort_order >= ?', 0) }
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class PaidUp::PlanFeatureSetting < ActiveRecord::Base
|
2
|
-
belongs_to :plan, class_name: 'PaidUp::Plan'
|
2
|
+
belongs_to :plan, class_name: 'PaidUp::Plan', foreign_key: 'plan_id', inverse_of: :plan_feature_settings
|
3
3
|
validates_presence_of :setting, :plan, :feature
|
4
4
|
|
5
5
|
after_initialize :catch_unlimited_in_setting
|
@@ -5,10 +5,10 @@
|
|
5
5
|
.plan.col-md-3
|
6
6
|
.well
|
7
7
|
%h2
|
8
|
-
= plan.
|
8
|
+
= plan.title
|
9
9
|
.small= plan_charge_human plan
|
10
10
|
%p= plan.description.html_safe
|
11
|
-
%div{class:plan.
|
11
|
+
%div{class:plan.title.gsub(' ',"_").downcase+'_subscribe_button'}
|
12
12
|
= plan_button plan
|
13
13
|
%h2= :features.l
|
14
14
|
.table-responsive
|
data/coverage/.last_run.json
CHANGED