Class: Effective::Datatables::QbSyncs
- Inherits:
-
Effective::Datatable
- Object
- Effective::Datatable
- Effective::Datatables::QbSyncs
- Defined in:
- app/models/effective/datatables/qb_syncs.rb
Instance Method Summary collapse
Instance Method Details
#collection ⇒ Object
24 25 26 |
# File 'app/models/effective/datatables/qb_syncs.rb', line 24 def collection Effective::QbTicket.includes(qb_requests: :order) end |
#search_column(collection, table_column, search_term, sql_column) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/models/effective/datatables/qb_syncs.rb', line 28 def search_column(collection, table_column, search_term, sql_column) if table_column[:name] == 'orders' order = Effective::Order.where(id: search_term).first if order.present? collection.where(id: Effective::QbRequest.where(order_id: order.id).pluck(:qb_ticket_id)) else collection.none end else super end end |