Sha256: cc3bef3b8264e4ed31c115b2a394d6c888a29528aff8c697df720a3b4f1abe20

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

module Aptible
  module Api
    class Database < Resource
      belongs_to :account
      embeds_one :last_operation
      has_one :disk
      has_one :service
      has_many :operations

      field :id
      field :handle
      field :type
      field :passphrase
      field :connection_url
      field :provisioned, type: Aptible::Resource::Boolean
      field :created_at, type: Time
      field :updated_at, type: Time
      field :status

      def failed?
        # TODO: Add failed status at API level
        operations.select { |o| o.type == 'provision' }.all?(&:failed?)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aptible-api-0.7.8 lib/aptible/api/database.rb