Sha256: b47d10a2711de1157528eaadcb878363917c3e2774d0face3c7b56ef561edb8c

Contents?: true

Size: 526 Bytes

Versions: 2

Compression:

Stored size: 526 Bytes

Contents

module Trailblazer
  class Finder
    module Adapters
      module ActiveRecord
        # ActiveRecord - Sorting Adapter
        module Sorting
          def self.included(base)
            base.extend Features::Sorting::ClassMethods
          end

          private

          def sort_it(entity_type, sort_attributes)
            entity_type.order(sort_attributes)
          end

          def sort_orders(sort_attr, sort_dir)
            { sort_attr.to_s => sort_dir }
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trailblazer-finder-0.1.4 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.1.3 lib/trailblazer/finder/adapters/active_record/sorting.rb