class Blacklight::Configuration::SortField

Public Instance Methods

normalize!(blacklight_config = nil) click to toggle source

@!attribute sort

@return [String] the sort specification to use; defaults to the value of field (which is used in the user-facing parameters)
# File lib/blacklight/configuration/sort_field.rb, line 7
def normalize! blacklight_config = nil
  super
  self.field ||= label&.parameterize
  self.field ||= sort

  self.sort ||= self.field

  self
end
validate!() click to toggle source
# File lib/blacklight/configuration/sort_field.rb, line 17
def validate!
  raise ArgumentError.new, "Must supply a sort string" if self.sort.nil?
end