effective_orders 5.0.3 → 5.0.4

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
  SHA256:
3
- metadata.gz: 55f4ecfb00c2ff8fca1e88711877ca4c4a2c5e2772857645b1793eb42d672f6d
4
- data.tar.gz: 97d1e59387d065240d3b0c160f725831d808ea153d6aedce2104f277c769e005
3
+ metadata.gz: '09e7e3354a9268cf3f5c7f000fe685c96c63e519c37269e534fb41669654c2ac'
4
+ data.tar.gz: b117ad0187b25c59a496c658eee479af26bf0843951676065e7bc82633e9803f
5
5
  SHA512:
6
- metadata.gz: 74166e809d54fd9b2b0f4c266e59da9b0f8ff0947ac2166f6e88686fcaecf05a1c6e520933a935568717beae55a1db032aca72902641fbd031ecf60fe0302527
7
- data.tar.gz: 464f54b750a6feab8ec0ad9df11c1b8591aa70d33a58faaf0cb03eb03d584ea4362fc9247f3ad3425e3269585cb78a18529cfc28c1ae41eadc0a28d2304f1298
6
+ metadata.gz: 22e01baa9aeced210808a95d75fd18ef77a40d5de9f0ae34c6c6e86a42f4e51292d5dfa43d43d1647f5ba6a0dcd06532511571c6d72bd04de811294d453f1134
7
+ data.tar.gz: bb0995769c746838c40cd58e905f6c1079db824ab521342bd59c9b2b492c8805d7b55e2f0568cf86b2f3db14c727f61c1c97fe96831d95db359e1812e1296cb5
@@ -14,7 +14,7 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
14
14
  end
15
15
 
16
16
  filters do
17
- if attributes[:user_id].blank? && attributes[:parent_id].blank?
17
+ unless attributes[:skip_filters]
18
18
  scope :purchased, default: true
19
19
  scope :deferred
20
20
  scope :refunds
@@ -84,13 +84,14 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
84
84
  end
85
85
 
86
86
  collection do
87
- scope = Effective::Order.all.includes(:addresses, :order_items, :user)
87
+ scope = Effective::Order.all.deep
88
88
 
89
89
  if EffectiveOrders.orders_collection_scope.respond_to?(:call)
90
90
  scope = EffectiveOrders.orders_collection_scope.call(scope)
91
91
  end
92
92
 
93
93
  if attributes[:user_id].present?
94
+ user = current_user.class.find(attributes[:user_id])
94
95
  scope = scope.where(user: user)
95
96
  end
96
97
 
@@ -101,8 +102,4 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
101
102
  scope
102
103
  end
103
104
 
104
- def user
105
- @user ||= current_user.class.find(attributes[:user_id])
106
- end
107
-
108
105
  end
@@ -59,7 +59,9 @@ class EffectiveOrdersDatatable < Effective::Datatable
59
59
  end
60
60
 
61
61
  collection do
62
- scope = Effective::Order.all.where(user: user).includes(:addresses, :order_items, :user)
62
+ user = current_user.class.find(attributes[:user_id])
63
+
64
+ scope = Effective::Order.all.deep.where(user: user)
63
65
 
64
66
  if EffectiveOrders.orders_collection_scope.respond_to?(:call)
65
67
  scope = EffectiveOrders.orders_collection_scope.call(scope)
@@ -76,8 +78,4 @@ class EffectiveOrdersDatatable < Effective::Datatable
76
78
  scope
77
79
  end
78
80
 
79
- def user
80
- @user ||= view.current_user.class.find(attributes[:user_id])
81
- end
82
-
83
81
  end
@@ -137,7 +137,7 @@ module Effective
137
137
  validates :payment_provider, presence: true, inclusion: { in: EffectiveOrders.deferred_providers }
138
138
  end
139
139
 
140
- scope :deep, -> { includes(:user, order_items: :purchasable) }
140
+ scope :deep, -> { includes(:addresses, :user, order_items: :purchasable) }
141
141
  scope :sorted, -> { order(:id) }
142
142
 
143
143
  scope :purchased, -> { where(state: EffectiveOrders::PURCHASED) }
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.0.3'.freeze
2
+ VERSION = '5.0.4'.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: 5.0.3
4
+ version: 5.0.4
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: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails