Sha256: d0355bbb3293e6981dee0a7d93cc33377629ffca2ce7eefff468872490f05fb9

Contents?: true

Size: 615 Bytes

Versions: 9

Compression:

Stored size: 615 Bytes

Contents

# frozen_string_literal: true

module Trailblazer
  class Finder
    module Adapters
      # ActiveRecord Adapter
      module ActiveRecord
        # ActiveRecord Paging Adapter
        module Sorting
          module_function

          def set_sorting_handler
            lambda do |sort_attributes, entity|
              sort_attributes.delete(:handler)
              attributes = []
              sort_attributes.each do |attr|
                attributes << {attr[0].to_s => attr[1]}
              end
              entity.order(attributes)
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trailblazer-finder-0.50.0 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.10.3 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.10.2 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.10.1 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.10.0 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.3.0 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.2.7 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.2.6 lib/trailblazer/finder/adapters/active_record/sorting.rb
trailblazer-finder-0.2.5 lib/trailblazer/finder/adapters/active_record/sorting.rb