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:
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