Sha256: b989f94cd9e076acaee9e99060b3ec808d07458c32709dcaac39aad120b5d758

Contents?: true

Size: 491 Bytes

Versions: 5

Compression:

Stored size: 491 Bytes

Contents

module Qujo
  module Concerns
    module Status
      extend ActiveSupport::Concern

      included do
        def accept
          self.accepted_at = Time.now
          self.save!
        end

        def cancel
          self.status = :cancelled
          self.save!
        end

        def retry
          self.accepted_at = nil
          self.status = :retry
          self.log << "--- retry ---"
          self.message = nil
          self.save
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qujo-0.1.4 lib/qujo/concerns/status.rb
qujo-0.1.3 lib/qujo/concerns/status.rb
qujo-0.1.2 lib/qujo/concerns/status.rb
qujo-0.1.1 lib/qujo/concerns/status.rb
qujo-0.1.0 lib/qujo/concerns/status.rb