Skip to content
Snippets Groups Projects
Commit 3caf0ba9 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix empty query sent to postgres for custom emojis (#5121)

parent 6e83b5e7
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,11 @@ class CustomEmoji < ApplicationRecord
class << self
def from_text(text, domain)
return [] if text.blank?
shortcodes = text.scan(SCAN_RE).map(&:first)
shortcodes = text.scan(SCAN_RE).map(&:first).uniq
return [] if shortcodes.empty?
where(shortcode: shortcodes, domain: domain)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment