Class: AhoyCaptain::DeviceQuery
- Inherits:
-
ApplicationQuery
- Object
- ApplicationQuery
- AhoyCaptain::DeviceQuery
- Defined in:
- app/queries/ahoy_captain/device_query.rb
Instance Attribute Summary
Attributes inherited from ApplicationQuery
Instance Method Summary collapse
Methods inherited from ApplicationQuery
call, inherited, #initialize, #inspect
Constructor Details
This class inherits a constructor from AhoyCaptain::ApplicationQuery
Instance Method Details
#build ⇒ Object
3 4 5 6 7 8 |
# File 'app/queries/ahoy_captain/device_query.rb', line 3 def build visit_query .select("#{params[:devices_type]} as label", "count(#{params[:devices_type]}) as count", "sum(count(#{params[:devices_type]})) over() as total_count") .group(params[:devices_type]) .order("count(#{params[:devices_type]}) desc") end |