effective_orders 3.1.4 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/datatables/effective_orders_datatable.rb +15 -0
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 829b63c36f8fc5cff852f4d6c20c71b0e4da56dab9b48da0781342b34157ccf5
|
4
|
+
data.tar.gz: 987977d07b8add975f0b834354b3f21dc087efcc69e4cac6f011da6e7327521a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae49e925c7282e59af58d78b034a9a720726df52b878b9ad6ac85d4f1dc8b7e627cf75b36b5fa9efbdc23591fbe1f71dbeca3ce1ab665d2d50eae6b21bd9e656
|
7
|
+
data.tar.gz: 3d0a6819d97f0f85432e4bec5627cb0fa8e46cfabc5458a78cdb0ea29d12aee6c938f5b7c3af5a5d1a53810e26be939a393678bcefaa5542109d4bc1f12aef72
|
@@ -15,6 +15,13 @@ class EffectiveOrdersDatatable < Effective::Datatable
|
|
15
15
|
)
|
16
16
|
end
|
17
17
|
|
18
|
+
filters do
|
19
|
+
if admin_namespace?
|
20
|
+
filter :start_date, nil, as: :effective_date_picker
|
21
|
+
filter :end_date, nil, as: :effective_date_picker
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
18
25
|
datatable do
|
19
26
|
order :created_at, :desc
|
20
27
|
|
@@ -94,6 +101,14 @@ class EffectiveOrdersDatatable < Effective::Datatable
|
|
94
101
|
scope = EffectiveOrders.orders_collection_scope.call(scope)
|
95
102
|
end
|
96
103
|
|
104
|
+
if filters[:start_date].present?
|
105
|
+
scope = scope.where('created_at > ?', Time.zone.parse(filters[:start_date]).beginning_of_day)
|
106
|
+
end
|
107
|
+
|
108
|
+
if filters[:end_date].present?
|
109
|
+
scope = scope.where('created_at < ?', Time.zone.parse(filters[:end_date]).end_of_day)
|
110
|
+
end
|
111
|
+
|
97
112
|
attributes[:user_id].present? ? scope.where(user_id: attributes[:user_id]) : scope
|
98
113
|
end
|
99
114
|
|
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: 3.1.
|
4
|
+
version: 3.1.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: 2019-
|
11
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|