effective_orders 5.0.3 → 5.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09e7e3354a9268cf3f5c7f000fe685c96c63e519c37269e534fb41669654c2ac'
|
4
|
+
data.tar.gz: b117ad0187b25c59a496c658eee479af26bf0843951676065e7bc82633e9803f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
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
|
-
|
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) }
|
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.
|
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-
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|