Browse Source

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

master
Eugen Rochko 7 years ago
committed by GitHub
parent
commit
3caf0ba923
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/models/custom_emoji.rb

+ 5
- 1
app/models/custom_emoji.rb View File

@ -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

Loading…
Cancel
Save