effective_qb_sync 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/datatables/qb_syncs.rb +17 -2
- data/lib/effective_qb_sync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a113b291316d9de42ed93d109383c450f78350c
|
4
|
+
data.tar.gz: a2abcdb6693ba01eca2bcdca3be61ee425a27cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba160b6f7a40947fb73c7e4f65b214403c39ca3b744a6dcdc36a844f16cdbd36b65e9a247c49c873cd6688bd50c4e0869f6debdd1e80d12ad573659e5869aa8c
|
7
|
+
data.tar.gz: 369745e8a4689be8f02714552583c9c7d9c0dbff590f25904481ca2382f4c3461f646d0da91d501b320600ce459e55383d9d40e2ac6eede5661f0d1d3236e4ad
|
@@ -12,18 +12,33 @@ if defined?(EffectiveDatatables)
|
|
12
12
|
qb_ticket.qb_requests.length
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
table_column :orders, sortable: false, as: :obfuscated_id do |qb_ticket|
|
16
16
|
qb_ticket.qb_requests.select { |qb_request| qb_request.order.present? }
|
17
17
|
.map { |qb_request| link_to "##{qb_request.order.to_param}", effective_orders.admin_order_path(qb_request.order) }
|
18
18
|
.join('<br>').html_safe
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
actions_column partial: 'admin/qb_syncs/actions', partial_local: :qb_sync
|
22
22
|
end
|
23
23
|
|
24
24
|
def collection
|
25
25
|
Effective::QbTicket.includes(qb_requests: :order)
|
26
26
|
end
|
27
|
+
|
28
|
+
def search_column(collection, table_column, search_term, sql_column)
|
29
|
+
if table_column[:name] == 'orders'
|
30
|
+
order = Effective::Order.where(id: search_term).first
|
31
|
+
|
32
|
+
if order.present?
|
33
|
+
collection.where(id: Effective::QbRequest.where(order_id: order.id).pluck(:qb_ticket_id))
|
34
|
+
else
|
35
|
+
collection.none
|
36
|
+
end
|
37
|
+
else
|
38
|
+
super
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
27
42
|
end
|
28
43
|
end
|
29
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_qb_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.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: 2016-09-
|
11
|
+
date: 2016-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|