debian-mirror-gitlab/app/models/user_status.rb
2018-11-18 11:00:15 +05:30

17 lines
414 B
Ruby

# frozen_string_literal: true
class UserStatus < ActiveRecord::Base
include CacheMarkdownField
self.primary_key = :user_id
DEFAULT_EMOJI = 'speech_balloon'.freeze
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