Sha256: c69b4a63bc280b7bbd264cd01ab0c5370c687e7dc0a3ba548ddf9417f8ce1af0

Contents?: true

Size: 561 Bytes

Versions: 49

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true
module Blacklight
  class Configuration::SortField < Blacklight::Configuration::Field
    # @!attribute sort
    #   @return [String] the sort specification to use; defaults to the value of field (which is used in the user-facing parameters)

    def normalize! blacklight_config = nil
      super
      self.field ||= label&.parameterize
      self.field ||= sort

      self.sort ||= self.field

      self
    end

    def validate!
      raise ArgumentError.new, "Must supply a sort string" if self.sort.nil?
    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
blacklight-7.40.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.39.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.38.0 lib/blacklight/configuration/sort_field.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/lib/blacklight/configuration/sort_field.rb
blacklight-7.37.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.36.2 lib/blacklight/configuration/sort_field.rb
blacklight-7.36.1 lib/blacklight/configuration/sort_field.rb
blacklight-7.36.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.35.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.34.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.33.1 lib/blacklight/configuration/sort_field.rb
blacklight-7.33.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.32.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.31.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.30.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.29.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.28.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.27.1 lib/blacklight/configuration/sort_field.rb
blacklight-7.27.0 lib/blacklight/configuration/sort_field.rb
blacklight-7.26.1 lib/blacklight/configuration/sort_field.rb