effective_orders 4.2.5 → 4.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 330e8560e071b8c2625a3ef75ad7f5a59076d708fcdeb68a20c9815d337e0020
4
- data.tar.gz: 0d665143facaaa2db3bd1c15856a78ea5bfbf4c3d54b138def40752061c8370c
3
+ metadata.gz: d19a1e1d922e08fadb09424738cfd86ae5c12db5e7553cbed17d4fb8a55ca57e
4
+ data.tar.gz: 0d65f0bbb387bbf804296a30f6822459bae66cdbd0053f82104f08af9d9b8c99
5
5
  SHA512:
6
- metadata.gz: 107af4d3f41950d0f2599a9cb2b2b6b2ede5d8c35db6dce6dd25402d98eddb47dfdccd238a71487b64db62a84cebc46b0be70f63f6ce0ce8abb30b017f5fbeb5
7
- data.tar.gz: ab98527b0806e1c461f78dce2b93c1e68964f1e373c87d34bb0bc167b1048598777c8c0bb31caefd95b18bbb248f66917ea80f1ba9724e38455eb2a397f05977
6
+ metadata.gz: 5ca8aa77355e8edfcb23834ff7f735f1ce3d775869ae9c6682d062b5fa4e0189e3afd7f29745d04abbd82d712b8272ec188cec8d210f8f8b23ec00d2ef0ff850
7
+ data.tar.gz: a4c3b95cfedd8600438a08e1f1b3ed93665e0f8ac45267ed6716a55079df483c731b2ffd4ce287a6d46488a4ccc8b9ec2ba04751f6d3e8338f04f84d0a0d5d45
@@ -22,13 +22,16 @@ class EffectiveOrdersDatatable < Effective::Datatable
22
22
  end
23
23
 
24
24
  datatable do
25
- order :id
25
+ order :id, :desc
26
26
 
27
27
  bulk_actions_col
28
28
 
29
29
  col :created_at, visible: false
30
30
  col :updated_at, visible: false
31
- col :id, visible: false
31
+
32
+ col :id, label: 'Number' do |order|
33
+ '#' + order.to_param
34
+ end
32
35
 
33
36
  col :purchased_at do |order|
34
37
  order.purchased_at&.strftime('%F %H:%M') || 'not purchased'
@@ -9,14 +9,14 @@
9
9
  %tbody
10
10
  %tr
11
11
  %td
12
- - unless EffectiveOrders.use_address_full_name
12
+ - if order.billing_address.blank? || !EffectiveOrders.use_address_full_name
13
13
  = order.billing_name
14
14
  %br
15
15
 
16
16
  - if order.billing_address.present?
17
- = render :partial => 'effective/addresses/address',
17
+ = render partial: 'effective/addresses/address',
18
18
  locals: { address: order.billing_address, email: order.user.email }
19
19
 
20
20
  - if order.shipping_address.present?
21
21
  %td
22
- = render :partial => 'effective/addresses/address', locals: { address: order.shipping_address }
22
+ = render partial: 'effective/addresses/address', locals: { address: order.shipping_address }
@@ -6,6 +6,10 @@
6
6
  - subscripter.quantity ||= subscripter.subscribable.subscribable_quantity_used
7
7
  - subscripter.stripe_plan_id ||= Hash(plans.first)[:id]
8
8
 
9
+ - if subscripter.stripe_plan_id.present? && plans.present? && plans.none? { |plan| plan[:id] == subscripter.stripe_plan_id }
10
+ - closest_plan = plans.find { |plan| plan[:interval] == subscripter.plan[:interval] }
11
+ - subscripter.stripe_plan_id = closest_plan[:id] if closest_plan.present?
12
+
9
13
  = effective_form_with(model: subscripter, url: effective_orders.subscripter_path, remote: true, data: { stripe: stripe, plans: plans }) do |f|
10
14
  = f.hidden_field :subscribable_global_id
11
15
  = f.hidden_field :stripe_token, value: nil
@@ -50,4 +54,7 @@
50
54
  = render 'effective/subscripter/plan', plan: plan, f: f
51
55
 
52
56
  = f.submit(border: false, center: true) do
53
- = f.save('Continue to Billing', class: ('effective-orders-stripe-token-required' if f.object.token_required?))
57
+ - if f.object.token_required?
58
+ = f.save('Continue to Billing', class: 'effective-orders-stripe-token-required')
59
+ - else
60
+ = f.save('Upgrade Now')
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.2.5'.freeze
2
+ VERSION = '4.2.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.5
4
+ version: 4.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails