Class: AhoyCaptain::Filters::SourcesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- ApplicationController
- BaseController
- AhoyCaptain::Filters::SourcesController
- Defined in:
- app/controllers/ahoy_captain/filters/sources_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
4 5 6 7 8 |
# File 'app/controllers/ahoy_captain/filters/sources_controller.rb', line 4 def index query = visit_query.all render json: query.select("distinct referring_domain").where.not(referring_domain: nil).group(:referring_domain).order(Arel.sql "count(*) desc").pluck(:referring_domain).map { |city| serialize(city) } end |