Sha256: b981a3b86a056d33fc32b4063452c16de31be080b5222989339610351df2f1c8

Contents?: true

Size: 447 Bytes

Versions: 19

Compression:

Stored size: 447 Bytes

Contents

module Blacklight
  class Configuration::SortField < Blacklight::Configuration::SolrField
    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
      super
    end

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
blacklight-5.9.4 lib/blacklight/configuration/sort_field.rb
blacklight-5.9.3 lib/blacklight/configuration/sort_field.rb
blacklight-5.9.2 lib/blacklight/configuration/sort_field.rb
blacklight-5.9.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.9.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.8.2 lib/blacklight/configuration/sort_field.rb
blacklight-5.8.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.8.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.7.2 lib/blacklight/configuration/sort_field.rb
blacklight-5.5.4 lib/blacklight/configuration/sort_field.rb
blacklight-5.7.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.7.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.6.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.5.3 lib/blacklight/configuration/sort_field.rb
blacklight-5.5.2 lib/blacklight/configuration/sort_field.rb
blacklight-5.5.1 lib/blacklight/configuration/sort_field.rb
blacklight-5.5.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.4.0 lib/blacklight/configuration/sort_field.rb
blacklight-5.4.0.rc1 lib/blacklight/configuration/sort_field.rb