2019-05-03 08:17:27 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-02-06 17:16:59 -05:00
|
|
|
class GroupUserSerializer < BasicUserSerializer
|
2018-12-06 12:18:52 +01:00
|
|
|
include UserPrimaryGroupMixin
|
2024-02-26 13:40:48 +00:00
|
|
|
include UserStatusMixin
|
2018-12-06 12:18:52 +01:00
|
|
|
|
2024-02-26 13:40:48 +00:00
|
|
|
attributes :name, :title, :last_posted_at, :last_seen_at, :added_at, :timezone
|
|
|
|
|
|
|
|
def initialize(object, options = {})
|
|
|
|
super
|
|
|
|
options[:include_status] = true
|
|
|
|
end
|
2022-12-14 13:18:09 +04:00
|
|
|
|
|
|
|
def timezone
|
|
|
|
user.user_option.timezone
|
|
|
|
end
|
2018-11-01 15:33:28 +11:00
|
|
|
|
2021-09-22 16:01:25 +03:00
|
|
|
def include_added_at?
|
2018-11-01 15:33:28 +11:00
|
|
|
object.respond_to? :added_at
|
|
|
|
end
|
2014-02-06 17:16:59 -05:00
|
|
|
end
|