class Blacklight::Configuration::FacetField

Public Instance Methods

normalize!(blacklight_config = nil) click to toggle source

rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity

# File lib/blacklight/configuration/facet_field.rb, line 69
def normalize! blacklight_config = nil
  query.stringify_keys! if query

  normalize_pivot_config! if pivot
  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
  self.item_presenter ||= Blacklight::FacetItemPresenter
  self.component = Blacklight::FacetFieldListComponent if component.nil? || component == true
  self.advanced_search_component ||= Blacklight::FacetFieldCheckboxesComponent
  self.item_component ||= Blacklight::FacetItemComponent
  super

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

  self
end

Private Instance Methods

normalize_pivot_config!() click to toggle source

rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity

# File lib/blacklight/configuration/facet_field.rb, line 95
def normalize_pivot_config!
  self.item_presenter ||= Blacklight::FacetItemPivotPresenter
  self.item_component ||= Blacklight::FacetItemPivotComponent
  self.filter_class ||= Blacklight::SearchState::PivotFilterField
  self.filter_query_builder ||= Blacklight::SearchState::PivotFilterField::QueryBuilder
end