debian-mirror-gitlab/app/models/user_status.rb

18 lines
406 B
Ruby
Raw Normal View History

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