Sha256: 98e31daccd1e157739c372d9363ca00bcfe911630efdb3cbef1b4944ee6defad

Contents?: true

Size: 675 Bytes

Versions: 18

Compression:

Stored size: 675 Bytes

Contents

module Blacklight
  class Configuration::SearchField < Blacklight::Configuration::SolrField
    def normalize! blacklight_config = nil
      # Some normalization, calculate display_label from key,
      # and make sure we have a qt from defaults.             
      self.key ||= self.field
      self.field ||= self.key
      self.label ||= self.key.try(:titlecase)
      self.qt ||= blacklight_config.default_solr_params[:qt] if blacklight_config && blacklight_config.default_solr_params
      self.if ||= self.include_in_simple_select
      super
    end

    def validate!
      raise ArgumentError.new("Must supply a search field key") if self.key.nil?
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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