gitlab-org--gitlab-foss/app/models/user_status.rb
Bob Van Landuyt f1d3ea63cf Show the status of a user in interactions
The status is shown for
- The author of a commit when viewing a commit
- Notes on a commit (regular/diff)
- The user that triggered a pipeline when viewing a pipeline
- The author of a merge request when viewing a merge request
- The author of notes on a merge request (regular/diff)
- The author of an issue when viewing an issue
- The author of notes on an issue
- The author of a snippet when viewing a snippet
- The author of notes on a snippet
- A user's profile page
- The list of members of a group/user
2018-07-30 15:01:26 +02:00

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