11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/blacklight_advanced_search/redirect_legacy_params_filter.rb', line 11
def self.before(controller)
params = controller.send(:params)
if params[:f_inclusive] && params[:f_inclusive].respond_to?(:each_pair)
legacy_converted = false
params[:f_inclusive].each_pair do |field, value|
next unless value.is_a? Hash
legacy_converted = true
params[:f_inclusive][field] = value.keys
end
if legacy_converted
controller.send(:redirect_to, params, :status => :moved_permanently)
end
end
end
|