Sha256: 5cd4244085ada0d7c3fd4a3151d5856f6833b07aa3e9295868a03f0f7544ae61

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 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 if self.if.nil?
      super
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-5.9.4 lib/blacklight/configuration/search_field.rb