Class: AhoyCaptain::Filters::OperatingSystems::NamesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- ApplicationController
- BaseController
- AhoyCaptain::Filters::OperatingSystems::NamesController
- Defined in:
- app/controllers/ahoy_captain/filters/operating_systems/names_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods included from Rangeable
Methods included from CompareMode
#compare_mode?, #comparison_mode, included
Instance Method Details
#index ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/ahoy_captain/filters/operating_systems/names_controller.rb', line 5 def index query = visit_query.all render json: query.select("distinct os").where.not(os: nil).group(:os).order(Arel.sql "count(*) desc").pluck(:os).map { |city| serialize(city) } end |