lib/blacklight/configuration/facet_field.rb in blacklight-6.25.0 vs lib/blacklight/configuration/facet_field.rb in blacklight-7.0.0.rc1
- old
+ new
@@ -1,20 +1,27 @@
# frozen_string_literal: true
module Blacklight
class Configuration::FacetField < Blacklight::Configuration::Field
+ extend Deprecation
+
def normalize! blacklight_config = nil
- self.query.stringify_keys! if self.query
+ query.stringify_keys! if query
- self.collapse = true if self.collapse.nil?
- self.show = true if self.show.nil?
- self.if = self.show if self.if.nil?
- self.index_range = 'A'..'Z' if self.index_range == true
+ 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
+ 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 self.single and self.tag.blank? and self.ex.blank?
- self.tag = "#{self.key}_single"
- self.ex = "#{self.key}_single"
+
+ if single && tag.blank? && ex.blank?
+ self.tag = "#{key}_single"
+ self.ex = "#{key}_single"
end
self
end
end