Sha256: ad95a63c0acb271e91bba9115e16c1908d9eacbc7f432482d98dd3da2c5c56f9

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

module Aptible
  module Api
    class Database < Resource
      belongs_to :account
      has_one :disk
      has_one :service
      has_one :last_operation
      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.7 lib/aptible/api/database.rb