2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
class UserStatus < ApplicationRecord
|
2018-11-18 11:00:15 +05:30
|
|
|
include CacheMarkdownField
|
|
|
|
|
|
|
|
self.primary_key = :user_id
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
DEFAULT_EMOJI = 'speech_balloon'
|
2018-11-18 11:00:15 +05:30
|
|
|
|
|
|
|
belongs_to :user
|
|
|
|
|
|
|
|
validates :user, presence: true
|
|
|
|
validates :emoji, inclusion: { in: Gitlab::Emoji.emojis_names }
|
|
|
|
validates :message, length: { maximum: 100 }, allow_blank: true
|
|
|
|
|
|
|
|
cache_markdown_field :message, pipeline: :emoji
|
|
|
|
end
|