Sha256: 9fdb24954ad0eb14efe9361925456cebeed6017b3ba9c9c05b4231f22c113dd1

Contents?: true

Size: 538 Bytes

Versions: 1

Compression:

Stored size: 538 Bytes

Contents

module Sso
  class ClientSerializer < ActiveModel::Serializer
    delegate :id, :active?, :revoked_at, :revoke_reason, :secret, to: :session

    attribute  :id, :key => :client_id
    attributes :id, :active?, :revoked_at, :revoke_reason, :secret, :random_token


    belongs_to :owner, serializer: Sso::OwnerSerializer # WTH : hack to load owner using serializer

    def session
      object.session
    end

    # WTH : i dont get why i have to do loops to customize my json output
    def owner
      session.owner
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper_sso-0.4.6 app/serializers/sso/client_serializer.rb