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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd112a5b677f76a096a67c7d3fd941b18b0e042d
4
- data.tar.gz: f9878d61652b1e8c7764b6b6395965e7a7a2069a
3
+ metadata.gz: 5a113b291316d9de42ed93d109383c450f78350c
4
+ data.tar.gz: a2abcdb6693ba01eca2bcdca3be61ee425a27cd4
5
5
  SHA512:
6
- metadata.gz: db8422828d6f4f2ac30d84030a7de4950774f76a270b901996b75db0018dc07b843ae0911069b4cfb344314db824e74f7f67d69e47e6216b92262abfefc725c5
7
- data.tar.gz: 7986d2607bdf2e05f898b4b992b224006b7d837f0b27fc900ddcaff4c4bb3087ff7f5ed5882d860404e64581f4b6bae6be742eaa609b0d3e54d72c0c5f560321
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
- array_column :orders do |qb_ticket|
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
- table_column :actions, sortable: false, filter: false, partial: 'admin/qb_syncs/actions', partial_local: :qb_sync
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveQbSync
2
- VERSION = '1.0.3'.freeze
2
+ VERSION = '1.0.4'.freeze
3
3
  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.3
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-07 00:00:00.000000000 Z
11
+ date: 2016-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails