Sha256: 555cb0c7cff27e5f63a6d5dcdd998a2cf1c1b6590f5004299ca1f5f9356607ef

Contents?: true

Size: 419 Bytes

Versions: 40

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true
module Blacklight
  class Configuration::SortField < Blacklight::Configuration::Field
    def normalize! blacklight_config = nil
      super
      self.field ||= self.label.try(:parameterize)
      self.field ||= self.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

40 entries across 40 versions & 1 rubygems

Version Path
blacklight-6.25.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.24.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.23.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.22.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.21.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.20.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.19.2 lib/blacklight/configuration/sort_field.rb
blacklight-6.19.1 lib/blacklight/configuration/sort_field.rb
blacklight-6.19.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.18.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.17.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.16.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.15.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.14.1 lib/blacklight/configuration/sort_field.rb
blacklight-6.14.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.13.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.12.0 lib/blacklight/configuration/sort_field.rb
blacklight-6.11.2 lib/blacklight/configuration/sort_field.rb
blacklight-6.11.1 lib/blacklight/configuration/sort_field.rb
blacklight-6.11.0 lib/blacklight/configuration/sort_field.rb