|
|
@ -21,7 +21,7 @@ class CustomEmoji < ApplicationRecord
|
|
|
|
:(#{SHORTCODE_RE_FRAGMENT}):
|
|
|
|
:(#{SHORTCODE_RE_FRAGMENT}):
|
|
|
|
(?=[^[:alnum:]:]|$)/x
|
|
|
|
(?=[^[: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_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 }
|
|
|
|
validates :shortcode, uniqueness: { scope: :domain }, format: { with: /\A#{SHORTCODE_RE_FRAGMENT}\z/ }, length: { minimum: 2 }
|
|
|
|