Sha256: ffec251877dd11f885a24ffec8fe8ed04456c90c087d52047caa83b19dafff1f
Contents?: true
Size: 548 Bytes
Versions: 8
Compression:
Stored size: 548 Bytes
Contents
class Dorsale::Alexandrie::AttachmentsSorter < Agilibox::Sorter def sort case column when :created_at, :updated_at {column => direction} when :name %(LOWER(#{model.table_name}.#{column}) #{direction}) when :attachment_type_name @collection = @collection.joins(:attachment_type) table = Dorsale::Alexandrie::AttachmentType.table_name %(LOWER(#{table}.name) #{direction}) else {created_at: :desc, id: :desc} end end private def model Dorsale::Alexandrie::Attachment end end
Version data entries
8 entries across 8 versions & 1 rubygems