Method: Blacklight::Configuration::FacetField#normalize!

Defined in:
lib/blacklight/configuration/facet_field.rb

#normalize!(blacklight_config = nil) ⇒ Object

rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# 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