Przeglądaj źródła

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

master
Eugen Rochko 6 lat temu
committed by GitHub
rodzic
commit
3caf0ba923
1 zmienionych plików z 5 dodań i 1 usunięć
  1. +5
    -1
      app/models/custom_emoji.rb

+ 5
- 1
app/models/custom_emoji.rb Wyświetl plik

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


Ładowanie…
Anuluj
Zapisz