Sha256: 6bf6a7c89876012b34b935750d9d29ea9f9d4262e3d3e529ef7f0c0bbf83fd45
Contents?: true
Size: 595 Bytes
Versions: 14
Compression:
Stored size: 595 Bytes
Contents
class Agilibox::Sorter include Agilibox::SortingHelper attr_reader :collection, :sort_param, :column, :direction def initialize(collection, sort_param) @collection = collection @sort_param = sort_param @column, @direction = sortable_column_order(sort_param.to_s) end def sort raise NotImplementedError end def call # Don't replace by `collection.reorder(sort)` # #sort can change #collection and must be called before #collection order = sort collection.reorder(order) end def self.call(*args) new(*args).call end end
Version data entries
14 entries across 14 versions & 1 rubygems