0
0
Fork 0

When processing custom emoji, ensure a non-animated version exists (#5230)

Use the non-animated version in web UI, but return both in API
This commit is contained in:
Eugen Rochko 2017-10-05 23:41:47 +02:00 committed by GitHub
parent 2559d9166c
commit b9c76e2edb
5 changed files with 9 additions and 5 deletions

View file

@ -21,7 +21,7 @@ class CustomEmoji < ApplicationRecord
:(#{SHORTCODE_RE_FRAGMENT}):
(?=[^[:alnum:]:]|$)/x
has_attached_file :image
has_attached_file :image, styles: { static: { format: 'png', convert_options: '-coalesce -strip' } }
validates_attachment :image, content_type: { content_type: 'image/png' }, presence: true, size: { in: 0..50.kilobytes }
validates :shortcode, uniqueness: { scope: :domain }, format: { with: /\A#{SHORTCODE_RE_FRAGMENT}\z/ }, length: { minimum: 2 }