app/models/orderable.rb
# This is the most important method in this class.
# If valid ordering arguments are provided, return a string to chain into
# ActiveRecord's query:
# order = Orderable.new('Auction', 'domain_name', 'desc')
# Auction.active.order(order.condition)
#
# If invalid, return the default value provided to .new or empty string.
# The caller should know what is a valid order.
This is the most important method in this class.

If invalid, return the default value provided to .new or empty string.
The caller should know what is a valid order.
This is the most important method in this class . If invalid return the default value provided to . new or empty string . The caller should know what is a valid order .
def condition
    if valid?
      "#{model.table_name}.#{column} #{direction}"
    else
      default || ''
    end
  end
def condition if valid? "#{model.table_name}.#{column} #{direction}" else default || '' end end
This is the most important method in this class.
This is the most important method in this class .