2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module UserStatusTooltip
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
include ActionView::Helpers::TagHelper
|
2019-05-30 16:15:17 +05:30
|
|
|
include ActionView::Context
|
2018-11-18 11:00:15 +05:30
|
|
|
include EmojiHelper
|
|
|
|
include UsersHelper
|
|
|
|
|
|
|
|
included do
|
|
|
|
expose :user_status_if_loaded, as: :status_tooltip_html
|
|
|
|
|
|
|
|
def user_status_if_loaded
|
2019-05-30 16:15:17 +05:30
|
|
|
return nil unless object.association(:status).loaded?
|
2018-11-18 11:00:15 +05:30
|
|
|
|
|
|
|
user_status(object)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|