From 80f0910e2141b24082b9143266a9a6cf1ef6a516 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 20 Mar 2019 17:29:12 +0100 Subject: Add support for custom emojis in poll options (#10322) * Backend changes for custom emoji support in poll options * Serialize poll emojis in REST API * Render custom emojis in poll options * Render custom emoji in poll options on public pages --- app/models/poll.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/poll.rb') diff --git a/app/models/poll.rb b/app/models/poll.rb index 6df230337..8f72c7b11 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -60,6 +60,10 @@ class Poll < ApplicationRecord !local? end + def emojis + @emojis ||= CustomEmoji.from_text(options.join(' '), account.domain) + end + class Option < ActiveModelSerializers::Model attributes :id, :title, :votes_count, :poll -- cgit