mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 10:38:14 +08:00
20 lines
420 B
Ruby
20 lines
420 B
Ruby
# frozen_string_literal: true
|
|
|
|
class InvitedUserSerializer < ApplicationSerializer
|
|
attributes :id, :redeemed_at, :user, :invite_source
|
|
|
|
def id
|
|
object.invite.id
|
|
end
|
|
|
|
def user
|
|
ser = InvitedUserRecordSerializer.new(object.user, scope: scope, root: false)
|
|
ser.invited_by = object.invite.invited_by
|
|
ser.as_json
|
|
end
|
|
|
|
def invite_source
|
|
object.invite.is_invite_link? ? "link" : "email"
|
|
end
|
|
end
|