Sha256: 5d29b1e975da02f4f502700ef80b531b647a87487b4db6fb548884e9879ffb1b
Contents?: true
Size: 294 Bytes
Versions: 5
Compression:
Stored size: 294 Bytes
Contents
module SortField extend ActiveSupport::Concern module ClassMethods def sort_field(prefix = '') prefix = "#{prefix}_" unless prefix == '' field "#{prefix}sort".to_sym, type: Integer scope "#{prefix}sorted".to_sym, -> { asc("#{prefix}sort".to_sym) } end end end
Version data entries
5 entries across 5 versions & 1 rubygems