Sha256: 28197ff2f726e7268f99d4e161a1b2de6811f498becca0e4a0f5a84490d539fb

Contents?: true

Size: 429 Bytes

Versions: 41

Compression:

Stored size: 429 Bytes

Contents

module Shipit
  class HookSerializer < ActiveModel::Serializer
    include ConditionalAttributes

    has_one :stack
    attributes :id, :url, :delivery_url, :content_type, :events, :insecure_ssl, :created_at, :updated_at

    def url
      if object.scoped?
        api_stack_hook_url(object.stack, object)
      else
        api_hook_url(object)
      end
    end

    def include_stack?
      object.scoped?
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.30.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.29.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.28.1 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.28.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.27.1 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.27.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.26.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.25.1 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.25.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.24.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.23.1 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.23.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.22.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.21.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.20.1 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.20.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.19.0 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.18.1 app/serializers/shipit/hook_serializer.rb
shipit-engine-0.18.0 app/serializers/shipit/hook_serializer.rb