2018-07-13 06:22:02 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-28 09:17:42 -04:00
|
|
|
class UserStatus < ApplicationRecord
|
2018-07-13 06:22:02 -04:00
|
|
|
include CacheMarkdownField
|
|
|
|
|
2018-07-16 12:18:52 -04:00
|
|
|
self.primary_key = :user_id
|
|
|
|
|
|
|
|
DEFAULT_EMOJI = 'speech_balloon'.freeze
|
|
|
|
|
2018-07-13 06:22:02 -04:00
|
|
|
belongs_to :user
|
|
|
|
|
|
|
|
validates :user, presence: true
|
|
|
|
validates :emoji, inclusion: { in: Gitlab::Emoji.emojis_names }
|
|
|
|
validates :message, length: { maximum: 100 }, allow_blank: true
|
|
|
|
|
2018-07-13 11:52:31 -04:00
|
|
|
cache_markdown_field :message, pipeline: :emoji
|
2018-07-13 06:22:02 -04:00
|
|
|
end
|