Sha256: 64cb54a05c0d507b91b073609d99c3b0803933b75d9c2bf8f91fe8d755cd15ca

Contents?: true

Size: 408 Bytes

Versions: 5

Compression:

Stored size: 408 Bytes

Contents

# frozen_string_literal: true

module DiscourseSubscriptionClient
  class SupplierSerializer < ApplicationSerializer
    attributes :id,
               :name,
               :url,
               :authorized,
               :authorized_at

    has_one :user, serializer: BasicUserSerializer, embed: :objects

    def authorized
      object.api_key.present? && object.authorized_at.present?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
discourse_subscription_client-0.1.11 app/serializers/discourse_subscription_client/supplier_serializer.rb
discourse_subscription_client-0.1.10 app/serializers/discourse_subscription_client/supplier_serializer.rb
discourse_subscription_client-0.1.9 app/serializers/discourse_subscription_client/supplier_serializer.rb
discourse_subscription_client-0.1.8 app/serializers/discourse_subscription_client/supplier_serializer.rb
discourse_subscription_client-0.1.7 app/serializers/discourse_subscription_client/supplier_serializer.rb