Class: SpreeCmCommissioner::GuestSearcherQuery
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::GuestSearcherQuery
- Defined in:
- app/queries/spree_cm_commissioner/guest_searcher_query.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:disable Metrics/PerceivedComplexity.
- #event_id ⇒ Object
-
#initialize(params) ⇒ GuestSearcherQuery
constructor
A new instance of GuestSearcherQuery.
Constructor Details
#initialize(params) ⇒ GuestSearcherQuery
5 6 7 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 5 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 3 def params @params end |
Instance Method Details
#call ⇒ Object
rubocop:disable Metrics/PerceivedComplexity
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 11 def call # rubocop:disable Metrics/PerceivedComplexity return SpreeCmCommissioner::Guest.none if event_id.blank? if params[:qr_data].present? && order_qr_data? search_by_order_qr elsif params[:qr_data].present? && line_item_qr_data? search_by_line_item_qr elsif params[:qr_data].present? && guest_qr_data? search_by_guest_qr elsif params[:term].present? search_by_term elsif params[:ids].present? SpreeCmCommissioner::Guest.complete_or_canceled.where(event_id: event_id, id: params[:ids]) else SpreeCmCommissioner::Guest.complete_or_canceled.where(event_id: event_id) end end |
#event_id ⇒ Object
9 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 9 def event_id = params[:event_id] |