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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc5d130a48c0b113e33404421ba00542550e229c
4
- data.tar.gz: ec101d5ce97160d3ea070f4d3c10235709c5da06
3
+ metadata.gz: 335fab8dafdbcbe809d161bb38022878df8db297
4
+ data.tar.gz: a9b3666398fdc7294d684cc0eaf8dc6ad2004aec
5
5
  SHA512:
6
- metadata.gz: b11cacc6c27e57e35eb2758a16f8219b32e0772a2cd48f6a184b659b4baab5c9a7499ba794d00fbdc69d491c08f98e3d1f31e100cc7e369b20431f1a805c9fde
7
- data.tar.gz: d80227e7af8967037b02e31c7bd5e6083da8a5d81578807ac5d529ea306830f3336a85383497a3f84280d650134ed7a59f82d836382603349a839e23f86244a8
6
+ metadata.gz: 005b35eed037a4782e448a36b059d09e23be1cf8ce641f8814ae0727e368e5a3a490267691a377b07a1cbe0fb92c324ae2832999dc10cedd9ed1ef8f5a7f7db6
7
+ data.tar.gz: 3996a7ea5cc9658a376d2e3f64fedaff54ae56fe91f6780a7399179c0e7a5d9448d785f5e46a7c7e202d0cbac2a1003fa1d3988f57c5b798d0cdb0656ee40971
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.3
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.name) }
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.name) }
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
@@ -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 :name, :stripe_id
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
@@ -8,7 +8,7 @@
8
8
  %th= :subscribe.l
9
9
  - for plan in plans
10
10
  %tr{ class: highlight_plan == plan ? 'info' : ''}
11
- %td= plan.name
11
+ %td= plan.title
12
12
  %td= plan_charge_human plan
13
13
  - for feature in features
14
14
  %td= feature_display feature, plan
@@ -5,10 +5,10 @@
5
5
  .plan.col-md-3
6
6
  .well
7
7
  %h2
8
- = plan.name
8
+ = plan.title
9
9
  .small= plan_charge_human plan
10
10
  %p= plan.description.html_safe
11
- %div{class:plan.name.gsub(' ',"_").downcase+'_subscribe_button'}
11
+ %div{class:plan.title.gsub(' ',"_").downcase+'_subscribe_button'}
12
12
  = plan_button plan
13
13
  %h2= :features.l
14
14
  .table-responsive
@@ -1,7 +1,7 @@
1
1
  - add_title :my_subscription_information.l
2
2
 
3
3
  %h2
4
- = current_user.plan.name
4
+ = current_user.plan.title
5
5
  .small= plan_charge_human current_user.plan
6
6
 
7
7
  = subscription_dl current_user.subscription
@@ -1,4 +1,4 @@
1
- - add_title :subscribe_to_plan.l plan_name: @plan.name
1
+ - add_title :subscribe_to_plan.l plan_name: @plan.title
2
2
 
3
3
  %p= @plan.description
4
4
  = features_table only: @plan, should_add_buttons: false
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 89.31
3
+ "covered_percent": 74.41
4
4
  }
5
5
  }