discourse/app/serializers/invited_user_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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 14:16:51 -05: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 14:16:51 -05:00
end