lib/roaster/query.rb
# Target represents the resource(s) scope on which is executed the query
Target represents the resource(s) scope on which is executed the query
Target represents the resource ( s ) scope on which is executed the query
def sorting_from_params(params, mapping)
      return {} if params[:sort].blank? || mapping.sortable_attributes.blank?
      if params[:sort].class == Hash
        sorting_parameters = {}
        params[:sort].each do |sorting_resource|
          sorting_parameters[sorting_resource[0].to_sym] = parse_sort_criteria sorting_resource[1]
        end
        sorting_parameters
      else
        {@target.resource_name => parse_sort_criteria(params[:sort])}
      end
    end
def sorting_from_params ( params , mapping ) return { } if params [ :sort ] . blank? || mapping . sortable_attributes . blank? if params [ :sort ] . class == Hash sorting_parameters = { } params [ :sort ] . each do | sorting_resource | sorting_parameters [ sorting_resource [ 0 ] . to_sym ] = parse_sort_criteria sorting_resource [ 1 ] end sorting_parameters else { @target . resource_name => parse_sort_criteria ( params [ :sort ] ) } end end
Target represents the resource(s) scope on which is executed the query
Target represents the resource ( s ) scope on which is executed the query
params
<not_specific>
mapping
<not_specific>