Sha256: b2961ae82e675fc0be31bc5dfb1b09a91328d5e3adcf64c174ac98cbe29a353f

Contents?: true

Size: 417 Bytes

Versions: 29

Compression:

Stored size: 417 Bytes

Contents

module Blacklight
  class Configuration::SortField < OpenStructWithHashAccess
    def normalize! blacklight_config
      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

29 entries across 29 versions & 1 rubygems

Version Path
blacklight-4.2.2 lib/blacklight/configuration/sort_field.rb
blacklight-4.2.1 lib/blacklight/configuration/sort_field.rb
blacklight-4.2.0 lib/blacklight/configuration/sort_field.rb
blacklight-4.1.0 lib/blacklight/configuration/sort_field.rb
blacklight-4.0.1 lib/blacklight/configuration/sort_field.rb
blacklight-3.8.2 lib/blacklight/configuration/sort_field.rb
blacklight-4.0.0 lib/blacklight/configuration/sort_field.rb
blacklight-4.0.0.rc2 lib/blacklight/configuration/sort_field.rb
blacklight-4.0.0.rc1 lib/blacklight/configuration/sort_field.rb
blacklight-4.0.0.pre7 lib/blacklight/configuration/sort_field.rb
blacklight-4.0.0.pre6 lib/blacklight/configuration/sort_field.rb
blacklight-3.8.1 lib/blacklight/configuration/sort_field.rb
blacklight-3.8.0 lib/blacklight/configuration/sort_field.rb
blacklight-3.7.2 lib/blacklight/configuration/sort_field.rb
blacklight-3.7.1 lib/blacklight/configuration/sort_field.rb
blacklight-3.7.0 lib/blacklight/configuration/sort_field.rb
blacklight-3.6.1.1 lib/blacklight/configuration/sort_field.rb
blacklight-3.6.0 lib/blacklight/configuration/sort_field.rb
blacklight-3.5.0 lib/blacklight/configuration/sort_field.rb
blacklight-3.4.2 lib/blacklight/configuration/sort_field.rb