-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hello @mrkamel
I was wondering if it would be possible to use a generator directly in the options of an attribute.
search_scope :search do
attributes person: [ "person.full_name", "person.display_name", "person.doc_id"]
options :person, left_wildcard: false
attributes partner_doc_id: ["person.doc_id" ]
options :partner_doc_id, raw_ilike: true
#...
generator :raw_ilike do |column_name, raw_value|
"( #{column_name} IS NOT NULL AND
regexp_replace(#{column_name}, '[^a-zA-Z0-9]+', '','g') ILIKE ('%' || regexp_replace('#{raw_value}', '[^a-zA-Z0-9]+', '','g') || '%')
)
"
end
endI know the generator is designed for hash based queries, but it would be a very useful feature to be able to apply it directly to an attribute.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels