Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-19 18:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-19 18:08:32 +0300
commit846dc476d835e43b123e0d66da3a60ed07f10641 (patch)
tree02231005811495589ab8bf4a2f4d52f80dc95117 /app/validators
parent2ef0b7f13d72eee215e3491a8db4623cbcdd845c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/gitlab/emoji_name_validator.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/validators/gitlab/emoji_name_validator.rb b/app/validators/gitlab/emoji_name_validator.rb
index c14d6e4ec78..c034a79214b 100644
--- a/app/validators/gitlab/emoji_name_validator.rb
+++ b/app/validators/gitlab/emoji_name_validator.rb
@@ -24,11 +24,9 @@ module Gitlab
end
def valid_custom_emoji?(record, value)
- namespace = record.try(:awardable).try(:namespace)
+ resource = record.try(:resource_parent)
- return unless namespace
-
- namespace.custom_emoji&.by_name(value.to_s)&.any?
+ CustomEmoji.for_resource(resource).by_name(value.to_s).any?
end
end
end