Module: Statuseable

Extended by:
ActiveSupport::Concern
Included in:
Ci::Commit, CommitStatus
Defined in:
app/models/concerns/statuseable.rb

Constant Summary collapse

AVAILABLE_STATUSES =
%w(pending running success failed canceled skipped)

Instance Method Summary collapse

Instance Method Details

#active?Boolean


74
75
76
# File 'app/models/concerns/statuseable.rb', line 74

def active?
  running? || pending?
end

#complete?Boolean


78
79
80
# File 'app/models/concerns/statuseable.rb', line 78

def complete?
  canceled? || success? || failed?
end

#started?Boolean


70
71
72
# File 'app/models/concerns/statuseable.rb', line 70

def started?
  !pending? && !canceled? && started_at
end