Commit 0255f6de authored by Rodrigo Souto's avatar Rodrigo Souto

pg-search: convert rails parameter to hash

parent 21c800c1
Pipeline #64482041 failed with stages
in 66 minutes and 57 seconds
......@@ -50,7 +50,7 @@ class PgSearchPlugin < Noosfero::Plugin
def active_filters asset, scope, params, query = nil
facets = params[:facets] || {}
periods = params[:periods] || default_periods_for(asset)
periods = (params[:periods] || default_periods_for(asset)).to_h
query ||= params[:query] || params[:q]
block = Block.find_by id: params[:block]
......@@ -108,7 +108,7 @@ class PgSearchPlugin < Noosfero::Plugin
facets.each do |term, values|
kind, klass = term.split('-')
if kind == 'attribute' || kind == 'relation' || kind == 'metadata'
arguments = values.map {|value, check| value if check == '1'}.compact
arguments = values.to_h.map {|value, check| value if check == '1'}.compact
arguments.map! {|argument| argument == ' ' ? nil : argument}
else
next
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment