2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-02-07 06:16:59 +08:00
|
|
|
class GroupUserSerializer < BasicUserSerializer
|
2018-12-06 19:18:52 +08:00
|
|
|
include UserPrimaryGroupMixin
|
2024-02-26 21:40:48 +08:00
|
|
|
include UserStatusMixin
|
2018-12-06 19:18:52 +08:00
|
|
|
|
2024-02-26 21:40:48 +08: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 17:18:09 +08:00
|
|
|
|
|
|
|
def timezone
|
|
|
|
user.user_option.timezone
|
|
|
|
end
|
2018-11-01 12:33:28 +08:00
|
|
|
|
2021-09-22 21:01:25 +08:00
|
|
|
def include_added_at?
|
2018-11-01 12:33:28 +08:00
|
|
|
object.respond_to? :added_at
|
|
|
|
end
|
2014-02-07 06:16:59 +08:00
|
|
|
end
|