discourse/app/serializers/emoji_serializer.rb
Robin Ward 7988a5f14b FIX: Don't raise an error if a custom emoji image was deleted
This could be catastrophic in production; a missing upload would mean
every request to the site would raise an error.
2020-12-09 15:40:40 -05:00

11 lines
207 B
Ruby

# frozen_string_literal: true
class EmojiSerializer < ApplicationSerializer
attributes :name, :url, :group
def url
return nil if object.url.blank?
Discourse.store.cdn_url(object.url)
end
end