Sha256: d390e97ea1d9e0a120648f91cfa7b1e11617d56e68ccb81b4dafda2f39bef965

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true
module Blacklight
  class Configuration::FacetField < Blacklight::Configuration::Field
    extend Deprecation

    def normalize! blacklight_config = nil
      query.stringify_keys! if query

      self.collapse = true if collapse.nil?
      self.show = true if show.nil?
      self.if = show if self.if.nil?
      self.index_range = 'A'..'Z' if index_range == true
      self.presenter = Blacklight::FacetFieldPresenter

      if link_to_search
        Deprecation.warn(Blacklight::Configuration::FacetField, '`link_to_search:` is deprecated, use `link_to_facet:` instead')
        self.link_to_facet = link_to_search if link_to_facet.nil?
      end

      super

      if single && tag.blank? && ex.blank?
        self.tag = "#{key}_single"
        self.ex = "#{key}_single"
      end

      self
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-7.11.1 lib/blacklight/configuration/facet_field.rb
blacklight-7.10.0 lib/blacklight/configuration/facet_field.rb