Create partial search formatter service

This commit is contained in:
Thiago Youssef 2022-03-29 10:11:22 +03:00
parent 8babae9a0e
commit 5a0c812a15

View file

@ -0,0 +1,13 @@
class PartialSearchFormatter
def self.format(search_params)
percentage = '%'
search_params.each do |key, value|
next unless key.include?('matches') && value.present?
value.prepend(percentage).concat(percentage)
end
search_params
end
end