9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/trailblazer/finder/activities/find.rb', line 9
def process_params(ctx, params:, **)
params.each do |attribute, value|
result = {}
filter_attribute = attribute.to_sym
fetch_filters(ctx, result, filter_attribute) || result if ctx[:filters].include?(filter_attribute)
fetch_properties(result, filter_attribute, value, ctx[:properties]) || result
next ctx[:params].delete(attribute) if result.empty?
ctx[:process] ||= {}
ctx[:process][filter_attribute] = result.merge!(value: value)
end
true
end
|