app/helpers/orderable_helper.rb
# Returns an Array of conditions that can be chained directly to order method.
# Makes sure that order is against allowed tables and columns that exist against those tables.
#
# To be used in controllers.
Returns an Array of conditions that can be chained directly to order method.
Makes sure that order is against allowed tables and columns that exist against those tables.

To be used in controllers.
Returns an Array of conditions that can be chained directly to order method . Makes sure that order is against allowed tables and columns that exist against those tables . To be used in controllers .
def orderable(orderable_params)
    unsafe_hash = orderable_params.to_unsafe_h
    unsafe_hash.map do |key, value|
      model_name, column = key.split('.')
      Orderable.new(model_name, column, value).condition
    end
  end
def orderable ( orderable_params ) unsafe_hash = orderable_params . to_unsafe_h unsafe_hash . map do | key , value | model_name , column = key . split ( '.' ) Orderable . new ( model_name , column , value ) . condition end end
Returns an Array of conditions that can be chained directly to order method.
Returns an Array of conditions that can be chained directly to order method .
# parameters are hash-like object, but we cannot trust anything that comes from the user to go # straight into the query.
orderable_params
<not_specific>