app/controllers/concerns/admin/stats_methods.rb
# Returns an array of filtered parameters that match our intended format.
#
# === Parameters
#
# [allowed] an array of parameter names to return, if set
Returns an array of filtered parameters that match our intended format.
Parameters

[allowed] an array of parameter names to return, if set
Returns an array of filtered parameters that match our intended format . Parameters [ allowed ] an array of parameter names to return if set
def filter_params( *allowed )
      filtered = params.permit( allowed ).to_h.symbolize_keys.select{ |k,v| v.match( FILTERS[ BASE_PARAMS[ k ]]) }
      filtered.update( filtered ) do |k,v|
        v = Date.parse( v ).at_midnight.utc if BASE_PARAMS[ k ] == :date
        v
      end
    end
def filter_params ( * allowed ) filtered = params . permit ( allowed ) . to_h . symbolize_keys . select { | k , v | v . match ( FILTERS [ BASE_PARAMS [ k ] ] ) } filtered . update ( filtered ) do | k , v | v = Date . parse ( v ) . at_midnight . utc if BASE_PARAMS [ k ] == :date v end end
Returns an array of filtered parameters that match our intended format.
Returns an array of filtered parameters that match our intended format .
# grab params # do any necessary parsing
allowed