Class: AhoyCaptain::Filters::OperatingSystems::VersionsController

Inherits:
BaseController show all
Defined in:
app/controllers/ahoy_captain/filters/operating_systems/versions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#period

Methods included from Rangeable

#period

Methods included from CompareMode

#compare_mode?, #comparison_mode, included

Instance Method Details

#indexObject



5
6
7
8
9
# File 'app/controllers/ahoy_captain/filters/operating_systems/versions_controller.rb', line 5

def index
  query = visit_query.all

  render json: query.select("distinct os_version").where.not(os_version: nil).group(:os_version).order(Arel.sql "count(*) desc").pluck(:os_version).map { |city| serialize(city) }
end