mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
Create partial search formatter service
This commit is contained in:
parent
8babae9a0e
commit
5a0c812a15
1 changed files with 13 additions and 0 deletions
13
app/services/partial_search_formatter.rb
Normal file
13
app/services/partial_search_formatter.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue