app/controllers/concerns/admin/stats_methods.rb
# Extracts stats by a given axis, depending on parameters passed in.
#
# === Parameters
#
# [axis] the axis to extract
Extracts stats by a given axis, depending on parameters passed in.
Parameters

[axis] the axis to extract
Extracts stats by a given axis depending on parameters passed in . Parameters [ axis ] the axis to extract
def extract_stats_by_axis( query, axis = nil )
    case axis.to_sym
    when :views
      query = query.by_date
    when :ua
      query = ( params.key?( :ua ) ? query.by_version : query.by_ua )
    when :country
      query = query.by_country
    when :content
      query = query.by_content
    end
    query
  end
def extract_stats_by_axis ( query , axis = nil ) case axis . to_sym when :views query = query . by_date when :ua query = ( params . key? ( :ua ) ? query . by_version : query . by_ua ) when :country query = query . by_country when :content query = query . by_content end query end
Extracts stats by a given axis, depending on parameters passed in.
Extracts stats by a given axis depending on parameters passed in .
# extract by date # extract by UA
query
axis