effective_orders 6.9.2 → 6.9.5

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: 0eb7f14bfc42d84987d1d976c538855e0afedc96d645517d4e56fab622d99b96
4
- data.tar.gz: cd087b17ba0a60521fdb1cc01b77f6a143d6b5eabda4b20a5b30e2d925fbe234
3
+ metadata.gz: 41a7cabd3ec382ec58b642aed68b6b90cb608fb089e438ed550262cbc569a63d
4
+ data.tar.gz: 9980165d58544c3f64774230e5c50cd26c95896df5d3f329c179d8f4daf8a3e0
5
5
  SHA512:
6
- metadata.gz: ef42dda56e817ab503e886deb2001434859a15fb1b409be5cf83c03ae60e98fdb0ff67e7efd1a28194647a8ef222d8cfa668db1d5ec8c7e95f08e50e49b7d7dd
7
- data.tar.gz: e3b9c7ac973aa14df168670a478140f75b67bf78a062bc667273efba120eba889370e8f4e339bb7c1543cffae82a433e5cf1a7b08a50d454dd4ad39d4b574733
6
+ metadata.gz: 9c949c47c769eefd302ad4a789583c8cdf0e443b74a43518c7164d88c4aa53c21891f4a1c0af6d05a48b65a528bc87f41e60d8431a29aac5e9d89cff29cc0bf4
7
+ data.tar.gz: 941e3ec2e9453e54057e82876c33094df40cbe1255a842e276d35087f3ae7e62db99a8f1497fcd44cb434e5db0b18cf362e2c461c7d0ed93ebeac04b95cd8cd8
@@ -21,7 +21,7 @@ module Admin
21
21
  }
22
22
 
23
23
  def create
24
- @order = Effective::Order.new
24
+ @order = Effective::Order.deep.new
25
25
  @order.assign_attributes(permitted_params)
26
26
 
27
27
  authorize_effective_order!
@@ -38,7 +38,7 @@ module Admin
38
38
  # The show page posts to this action
39
39
  # See Effective::OrdersController checkout
40
40
  def checkout
41
- @order = Effective::Order.was_not_purchased.find(params[:id])
41
+ @order = Effective::Order.deep.was_not_purchased.find(params[:id])
42
42
 
43
43
  authorize_effective_order!
44
44
 
@@ -61,7 +61,7 @@ module Admin
61
61
  end
62
62
 
63
63
  def destroy
64
- @order = Effective::Order.all.was_not_purchased.find(params[:id])
64
+ @order = Effective::Order.deep.was_not_purchased.find(params[:id])
65
65
 
66
66
  authorize_effective_order!
67
67
 
@@ -75,7 +75,7 @@ module Admin
75
75
  end
76
76
 
77
77
  def send_payment_request
78
- @order = Effective::Order.was_not_purchased.find(params[:id])
78
+ @order = Effective::Order.deep.was_not_purchased.find(params[:id])
79
79
  authorize_effective_order!
80
80
 
81
81
  if @order.send_payment_request_to_buyer!
@@ -88,7 +88,7 @@ module Admin
88
88
  end
89
89
 
90
90
  def bulk_send_payment_request
91
- @orders = Effective::Order.was_not_purchased.where(id: params[:ids])
91
+ @orders = Effective::Order.deep.was_not_purchased.where(id: params[:ids])
92
92
 
93
93
  begin
94
94
  authorize_effective_order!
@@ -10,7 +10,7 @@ module Effective
10
10
 
11
11
  def show
12
12
  @cart = current_cart
13
- @pending_orders = Effective::Order.was_not_purchased.where(user: current_user) if current_user.present?
13
+ @pending_orders = Effective::Order.deep.was_not_purchased.where(user: current_user) if current_user.present?
14
14
 
15
15
  @page_title ||= 'My Cart'
16
16
  EffectiveResources.authorize!(self, :show, @cart)
@@ -12,7 +12,7 @@ module Effective
12
12
  page_title 'Customer Settings'
13
13
 
14
14
  def resource
15
- @customer = Effective::Customer.where(user: current_user).first!
15
+ @customer = Effective::Customer.deep.where(user: current_user).first!
16
16
  @subscripter ||= Effective::Subscripter.new(customer: @customer, current_user: current_user)
17
17
  end
18
18
 
@@ -29,7 +29,7 @@ module Effective
29
29
  # It displayes an order based on the cart
30
30
  # Always step1
31
31
  def new
32
- @order ||= Effective::Order.new(view_context.current_cart)
32
+ @order ||= Effective::Order.deep.new(view_context.current_cart)
33
33
 
34
34
  EffectiveResources.authorize!(self, :new, @order)
35
35
 
@@ -42,7 +42,7 @@ module Effective
42
42
 
43
43
  # Confirms an order from the cart.
44
44
  def create
45
- @order ||= Effective::Order.new(view_context.current_cart)
45
+ @order ||= Effective::Order.deep.new(view_context.current_cart)
46
46
  EffectiveResources.authorize!(self, :create, @order)
47
47
 
48
48
  @order.assign_attributes(checkout_params)
@@ -61,7 +61,7 @@ module Effective
61
61
  # This is the entry point for an existing order.
62
62
  # Might render step1 or step2
63
63
  def show
64
- @order ||= Effective::Order.find(params[:id])
64
+ @order ||= Effective::Order.deep.find(params[:id])
65
65
  @page_title ||= view_context.order_page_title(@order)
66
66
 
67
67
  EffectiveResources.authorize!(self, :show, @order)
@@ -69,7 +69,7 @@ module Effective
69
69
 
70
70
  # Always step1
71
71
  def edit
72
- @order ||= Effective::Order.was_not_purchased.find(params[:id])
72
+ @order ||= Effective::Order.deep.was_not_purchased.find(params[:id])
73
73
  @page_title ||= view_context.order_page_title(@order)
74
74
 
75
75
  EffectiveResources.authorize!(self, :edit, @order)
@@ -77,7 +77,7 @@ module Effective
77
77
 
78
78
  # Confirms the order from existing order
79
79
  def update
80
- @order ||= Effective::Order.was_not_purchased.find(params[:id])
80
+ @order ||= Effective::Order.deep.was_not_purchased.find(params[:id])
81
81
  EffectiveResources.authorize!(self, :update, @order)
82
82
 
83
83
  @order.assign_attributes(checkout_params)
@@ -92,23 +92,23 @@ module Effective
92
92
 
93
93
  # Thank you for Purchasing this Order. This is where a successfully purchased order ends up
94
94
  def purchased # Thank You!
95
- @order = Effective::Order.purchased.find(params[:id])
95
+ @order = Effective::Order.deep.purchased.find(params[:id])
96
96
  EffectiveResources.authorize!(self, :show, @order)
97
97
  end
98
98
 
99
99
  def deferred
100
- @order = Effective::Order.deferred.find(params[:id])
100
+ @order = Effective::Order.deep.deferred.find(params[:id])
101
101
  EffectiveResources.authorize!(self, :show, @order)
102
102
  end
103
103
 
104
104
  def declined
105
- @order = Effective::Order.declined.find(params[:id])
105
+ @order = Effective::Order.deep.declined.find(params[:id])
106
106
  EffectiveResources.authorize!(self, :show, @order)
107
107
  end
108
108
 
109
109
  # This is used by both the Admin and User
110
110
  def send_buyer_receipt
111
- @order = Effective::Order.purchased.find(params[:id])
111
+ @order = Effective::Order.deep.purchased.find(params[:id])
112
112
 
113
113
  EffectiveResources.authorize!(self, :show, @order)
114
114
 
@@ -122,7 +122,7 @@ module Effective
122
122
  end
123
123
 
124
124
  def bulk_send_buyer_receipt
125
- @orders = Effective::Order.purchased.where(id: params[:ids])
125
+ @orders = Effective::Order.deep.purchased.where(id: params[:ids])
126
126
 
127
127
  begin
128
128
  EffectiveResources.authorize!(self, :index, Effective::Order.new(user: current_user))
@@ -6,7 +6,7 @@ module Effective
6
6
  def cheque
7
7
  raise('cheque provider is not available') unless EffectiveOrders.cheque?
8
8
 
9
- @order ||= Order.find(params[:id])
9
+ @order ||= Order.deep.find(params[:id])
10
10
 
11
11
  EffectiveResources.authorize!(self, :update, @order)
12
12
 
@@ -6,7 +6,7 @@ module Effective
6
6
  def etransfer
7
7
  raise('etransfer provider is not available') unless EffectiveOrders.etransfer?
8
8
 
9
- @order ||= Order.find(params[:id])
9
+ @order ||= Order.deep.find(params[:id])
10
10
 
11
11
  EffectiveResources.authorize!(self, :update, @order)
12
12
 
@@ -6,7 +6,7 @@ module Effective
6
6
  def free
7
7
  raise('free provider is not available') unless EffectiveOrders.free?
8
8
 
9
- @order ||= Order.find(params[:id])
9
+ @order ||= Order.deep.find(params[:id])
10
10
 
11
11
  EffectiveResources.authorize!(self, :update, @order)
12
12
 
@@ -6,7 +6,7 @@ module Effective
6
6
  def mark_as_paid
7
7
  raise('mark_as_paid provider is not available') unless EffectiveOrders.mark_as_paid?
8
8
 
9
- @order ||= Order.find(params[:id])
9
+ @order ||= Order.deep.find(params[:id])
10
10
 
11
11
  EffectiveResources.authorize!(self, :update, @order)
12
12
  EffectiveResources.authorize!(self, :admin, :effective_orders)
@@ -12,7 +12,7 @@ module Effective
12
12
  def moneris_postback
13
13
  raise('moneris provider is not available') unless EffectiveOrders.moneris?
14
14
 
15
- @order ||= Effective::Order.find(params[:response_order_id])
15
+ @order ||= Effective::Order.deep.find(params[:response_order_id])
16
16
 
17
17
  # We do this even if we're not authorized
18
18
  EffectiveResources.authorized?(self, :update, @order)
@@ -6,7 +6,7 @@ module Effective
6
6
  def moneris_checkout
7
7
  raise('moneris_checkout provider is not available') unless EffectiveOrders.moneris_checkout?
8
8
 
9
- @order = Order.find(params[:id])
9
+ @order = Order.deep.find(params[:id])
10
10
 
11
11
  # We do this even if we're not authorized.
12
12
  EffectiveResources.authorized?(self, :update, @order)
@@ -12,7 +12,7 @@ module Effective
12
12
  def paypal_postback
13
13
  raise('paypal provider is not available') unless EffectiveOrders.paypal?
14
14
 
15
- @order ||= Effective::Order.where(id: (params[:invoice].to_i rescue 0)).first
15
+ @order ||= Effective::Order.deep.where(id: (params[:invoice].to_i rescue 0)).first
16
16
 
17
17
  # We do this even if we're not authorized
18
18
  EffectiveResources.authorized?(self, :update, @order)
@@ -6,7 +6,7 @@ module Effective
6
6
  def phone
7
7
  raise('phone provider is not available') unless EffectiveOrders.phone?
8
8
 
9
- @order ||= Order.find(params[:id])
9
+ @order ||= Order.deep.find(params[:id])
10
10
 
11
11
  EffectiveResources.authorize!(self, :update, @order)
12
12
 
@@ -6,7 +6,7 @@ module Effective
6
6
  def pretend
7
7
  raise('pretend provider is not available') unless EffectiveOrders.pretend?
8
8
 
9
- @order ||= Order.find(params[:id])
9
+ @order ||= Order.deep.find(params[:id])
10
10
 
11
11
  EffectiveResources.authorize!(self, :update, @order)
12
12
 
@@ -7,7 +7,7 @@ module Effective
7
7
  raise('refund provider is not available') unless EffectiveOrders.refund?
8
8
  raise('refund provider is not configured for buyer purchase') unless EffectiveOrders.buyer_purchases_refund?
9
9
 
10
- @order ||= Order.find(params[:id])
10
+ @order ||= Order.deep.find(params[:id])
11
11
 
12
12
  EffectiveResources.authorize!(self, :update, @order)
13
13
 
@@ -6,7 +6,7 @@ module Effective
6
6
  def stripe
7
7
  raise('stripe provider is not available') unless EffectiveOrders.stripe?
8
8
 
9
- @order = Order.find(params[:id])
9
+ @order = Order.deep.find(params[:id])
10
10
  @customer = Effective::Customer.for_user(current_user)
11
11
 
12
12
  EffectiveResources.authorize!(self, :update, @order)
@@ -23,9 +23,9 @@ module Admin
23
23
  col :organization
24
24
  end
25
25
 
26
- col :user
27
- col :order_items
28
- col :payment_provider, search: EffectiveOrders.payment_providers
26
+ col :user, visible: false
27
+ col :order_items, visible: false
28
+ col :payment_provider, search: EffectiveOrders.payment_providers, visible: false
29
29
  col :payment_method
30
30
 
31
31
  col :subtotal, as: :price
@@ -15,13 +15,13 @@ module Admin
15
15
  col :total, as: :price
16
16
 
17
17
  payment_providers.each do |provider|
18
- col(provider, as: :price)
18
+ col("p - #{provider}", as: :price, visible: false)
19
19
  end
20
20
 
21
21
  col :orders_count
22
22
 
23
- col :orders
24
- col :users
23
+ col :orders, visible: false
24
+ col :users, visible: false
25
25
 
26
26
  col :filtered_start_date, as: :date, search: false, sort: false, visible: false do
27
27
  date_range.begin&.strftime('%F')
@@ -15,13 +15,13 @@ module Admin
15
15
  col :total, as: :price
16
16
 
17
17
  payment_providers.each do |provider|
18
- col(provider, as: :price)
18
+ col("p - #{provider}", as: :price, visible: false)
19
19
  end
20
20
 
21
21
  col :orders_count
22
22
 
23
- col :orders
24
- col :users
23
+ col :orders, visible: false
24
+ col :users, visible: false
25
25
 
26
26
  col :start_date, as: :date, search: false, sort: false, visible: false do
27
27
  date_range.begin&.strftime('%F')
@@ -103,7 +103,10 @@ module Effective
103
103
  serialize :payment, Hash
104
104
  end
105
105
 
106
- scope :deep, -> { includes(:addresses, :user, :purchased_by, :organization, order_items: :purchasable) }
106
+ scope :deep, -> {
107
+ includes(:addresses, :user, :parent, :purchased_by, :organization, order_items: :purchasable)
108
+ }
109
+
107
110
  scope :sorted, -> { order(:id) }
108
111
 
109
112
  scope :purchased, -> { where(status: :purchased) }
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.9.2'.freeze
2
+ VERSION = '6.9.5'.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: 6.9.2
4
+ version: 6.9.5
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: 2023-11-29 00:00:00.000000000 Z
11
+ date: 2023-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails