2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-02-06 16:16:59 -06:00
|
|
|
class GroupUserSerializer < BasicUserSerializer
|
2018-12-06 05:18:52 -06:00
|
|
|
include UserPrimaryGroupMixin
|
|
|
|
|
|
|
|
attributes :name, :title, :last_posted_at, :last_seen_at, :added_at, :timezone, :status
|
2022-12-14 03:18:09 -06:00
|
|
|
|
|
|
|
def timezone
|
|
|
|
user.user_option.timezone
|
|
|
|
end
|
2018-10-31 23:33:28 -05:00
|
|
|
|
2021-09-22 08:01:25 -05:00
|
|
|
def include_added_at?
|
2018-10-31 23:33:28 -05:00
|
|
|
object.respond_to? :added_at
|
|
|
|
end
|
2018-12-06 05:18:52 -06:00
|
|
|
|
2022-12-14 03:18:09 -06:00
|
|
|
def include_status?
|
|
|
|
SiteSetting.enable_user_status && user.has_status?
|
|
|
|
end
|
|
|
|
|
|
|
|
def status
|
|
|
|
UserStatusSerializer.new(user.user_status, root: false)
|
|
|
|
end
|
2014-02-06 16:16:59 -06:00
|
|
|
end
|