Sha256: 9fb00575416c21dbe3760670b809beff1f6148d0f1d1a0b938a7f2e8cd009bbc

Contents?: true

Size: 643 Bytes

Versions: 10

Compression:

Stored size: 643 Bytes

Contents

module BlacklightRangeLimit
  # Override the upstream normalize method to inject range limit defaults
  module FacetFieldConfigOverride
    def normalize!(*args)
      normalize_range! if range

      super
    end

    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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
blacklight_range_limit-9.0.0 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-9.0.0.beta2 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-9.0.0.beta1 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.5.0 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.4.0 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.3.0 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.2.3 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.2.2 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.2.1 lib/blacklight_range_limit/facet_field_config_override.rb
blacklight_range_limit-8.2.0 lib/blacklight_range_limit/facet_field_config_override.rb