discourse/app/serializers/invited_user_serializer.rb

20 lines
420 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class InvitedUserSerializer < ApplicationSerializer
attributes :id, :redeemed_at, :user, :invite_source
2013-02-05 13:16:51 -06:00
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
2013-02-05 13:16:51 -06:00
end