Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/searchlight/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def self.excluding_empties(input)
output[key] = value.reject { |_, v| empty?(v) }
end
if value.instance_of?(Array)
output[key] = value.reject { |v| empty?(v) }
# output[key] = value.reject { |v| empty?(v) } # Do not remove empty values in a non-empty Array. FIXME: Make this an option or configurable.
output[key] = nil if output[key].all?(&:blank?) # If Array is entirely empty (i.e. `nil` or empty Strings only) then remove it.
end
end
output.reject { |_, value| empty?(value) }
Expand Down