Class: SolidLoop::Admin::EventsQuery
- Defined in:
- app/queries/solid_loop/admin/events_query.rb
Instance Attribute Summary
Attributes inherited from BaseQuery
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params, scope: SolidLoop::Event.order(created_at: :desc)) ⇒ EventsQuery
constructor
A new instance of EventsQuery.
Constructor Details
#initialize(params, scope: SolidLoop::Event.order(created_at: :desc)) ⇒ EventsQuery
Returns a new instance of EventsQuery.
4 5 6 |
# File 'app/queries/solid_loop/admin/events_query.rb', line 4 def initialize(params, scope: SolidLoop::Event.order(created_at: :desc)) super end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/queries/solid_loop/admin/events_query.rb', line 8 def call filtered = scope filtered = filtered.where(loop_id: loop_id) if loop_id filtered = filtered.where(name: name) if name filtered = filtered.where(eventable_type: eventable_type) if eventable_type filtered end |