Sha256: 524d347570eece68e9280dd26b65aef4d90f0d69ab7672678f69bfc8d2f015dc

Contents?: true

Size: 423 Bytes

Versions: 26

Compression:

Stored size: 423 Bytes

Contents

module Blacklight
  class Configuration::SortField < OpenStructWithHashAccess
    def normalize! blacklight_config = nil
      self.sort ||= self.field

      self.field ||= self.key
      self.field ||= self.label.try(:parameterize)
      self.field ||= self.sort

      self.key ||= self.field
    end

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
blacklight-4.9.0 lib/blacklight/configuration/sort_field.rb
blacklight-4.8.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.3.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.3 lib/blacklight/configuration/sort_field.rb
blacklight-5.1.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.2.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.1.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.2 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.0 lib/blacklight/configuration/sort_field.rb
blacklight-4.7.0 lib/blacklight/configuration/sort_field.rb
blacklight-4.7.0.pre1 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.0.pre4 lib/blacklight/configuration/sort_field.rb
blacklight-4.6.3 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.0.pre3 lib/blacklight/configuration/sort_field.rb
blacklight-4.6.2 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.0.pre2 lib/blacklight/configuration/sort_field.rb
blacklight-4.6.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.0.0.pre1 lib/blacklight/configuration/sort_field.rb
blacklight-4.6.0 lib/blacklight/configuration/sort_field.rb