diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-11 21:06:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-11 21:06:27 +0300 |
commit | ff67e3ed08355fb2d6f6e69d4ed06cd09052e573 (patch) | |
tree | 97ac29ddd32b612343b34bbdd6b8d57526b3d308 /app/models/award_emoji.rb | |
parent | 7071f9bf3e131a7a668922ee450da529f1866b6f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/award_emoji.rb')
-rw-r--r-- | app/models/award_emoji.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb index 24fcb97db6e..5a33a8f89df 100644 --- a/app/models/award_emoji.rb +++ b/app/models/award_emoji.rb @@ -6,11 +6,14 @@ class AwardEmoji < ApplicationRecord include Participable include GhostUser + include Importable belongs_to :awardable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :user - validates :awardable, :user, presence: true + validates :user, presence: true + validates :awardable, presence: true, unless: :importing? + validates :name, presence: true, inclusion: { in: Gitlab::Emoji.emojis_names } validates :name, uniqueness: { scope: [:user, :awardable_type, :awardable_id] }, unless: :ghost_user? |