Class: SortySorter::Sort

Inherits:
Object
  • Object
show all
Defined in:
lib/sorty_sorter/sort.rb

Class Method Summary collapse

Class Method Details

.apply(collection, column = nil, direction = nil) ⇒ Object



3
4
5
# File 'lib/sorty_sorter/sort.rb', line 3

def self.apply(collection, column = nil, direction = nil)
  collection.order(Params.new(column, direction, collection).options)
end

.apply!(collection, column = nil, direction = nil) ⇒ Object



7
8
9
# File 'lib/sorty_sorter/sort.rb', line 7

def self.apply!(collection, column = nil, direction = nil)
  collection.order(Params.new(column, direction, collection).options!)
end