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>2020-12-17 14:59:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 14:59:07 +0300
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /app/serializers/concerns/user_status_tooltip.rb
parent4b1de649d0168371549608993deac953eb692019 (diff)
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/serializers/concerns/user_status_tooltip.rb')
-rw-r--r--app/serializers/concerns/user_status_tooltip.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/serializers/concerns/user_status_tooltip.rb b/app/serializers/concerns/user_status_tooltip.rb
index 633b117d392..fcf6700cb59 100644
--- a/app/serializers/concerns/user_status_tooltip.rb
+++ b/app/serializers/concerns/user_status_tooltip.rb
@@ -8,12 +8,18 @@ module UserStatusTooltip
include UsersHelper
included do
- expose :user_status_if_loaded, as: :status_tooltip_html
+ expose :status_tooltip_html, if: -> (*) { status_loaded? } do |user|
+ user_status(user)
+ end
+
+ expose :show_status do |user|
+ status_loaded? && show_status_emoji?(user.status)
+ end
- def user_status_if_loaded
- return unless object.association(:status).loaded?
+ private
- user_status(object)
+ def status_loaded?
+ object.association(:status).loaded?
end
end
end