Sha256: 1c437904361cb69e9fc00b3ccf687b97645336935be74e27972a5839d205fdda

Contents?: true

Size: 471 Bytes

Versions: 3

Compression:

Stored size: 471 Bytes

Contents

module DeepThought
  class Deploy < ActiveRecord::Base
    belongs_to :project
    belongs_to :user

    after_create :queue

    validates_presence_of :branch
    validates_presence_of :commit
    validates_presence_of :project
    validates_presence_of :user

    def queue
      Delayed::Job.enqueue self

      DeepThought::Scaler.scale
    end

    def perform
      DeepThought::Deployer.execute(self)
    end

    def max_attempts
      return 1
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deep_thought-0.2.1 lib/deep_thought/models/deploy.rb
deep_thought-0.1.1 lib/deep_thought/models/deploy.rb
deep_thought-0.1.0 lib/deep_thought/models/deploy.rb