Use Arel `matches` method in CustomEmoji search (#28615)

th-downstream
Matt Jankowski 10 months ago committed by GitHub
parent cc67943df2
commit e827c4692c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,7 +86,7 @@ class CustomEmoji < ApplicationRecord
end
def search(shortcode)
where('"custom_emojis"."shortcode" ILIKE ?', "%#{shortcode}%")
where(arel_table[:shortcode].matches("%#{sanitize_sql_like(shortcode)}%"))
end
end

Loading…
Cancel
Save