2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-10-22 15:53:08 -04:00
|
|
|
class ApiKeySerializer < ApplicationSerializer
|
|
|
|
|
|
|
|
attributes :id,
|
2019-10-09 09:24:14 -04:00
|
|
|
:key,
|
|
|
|
:last_used_at,
|
|
|
|
:created_at
|
2013-10-22 15:53:08 -04:00
|
|
|
|
|
|
|
has_one :user, serializer: BasicUserSerializer, embed: :objects
|
|
|
|
|
|
|
|
def include_user_id?
|
|
|
|
!object.user_id.nil?
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|