Module: BlacklightRangeLimit::FacetFieldConfigOverride

Defined in:
lib/blacklight_range_limit/facet_field_config_override.rb

Overview

Override the upstream normalize method to inject range limit defaults

Instance Method Summary collapse

Instance Method Details

#normalize!(*args) ⇒ Object



4
5
6
7
8
# File 'lib/blacklight_range_limit/facet_field_config_override.rb', line 4

def normalize!(*args)
  normalize_range! if range

  super
end

#normalize_range!Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/blacklight_range_limit/facet_field_config_override.rb', line 10

def normalize_range!
  self.had_existing_component_configuration = component.present?

  if range.is_a? Hash
    self.range_config = range
    self.range = true
  end

  if range_config
    self.range_config = range_config.reverse_merge(BlacklightRangeLimit.default_range_config[:range_config])
  end

  @table.reverse_merge!(BlacklightRangeLimit.default_range_config)
end