Commit 34a472f6 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'statuseable-hasstatus' into 'master'

rename Statuseable to HasStatus

## What does this MR do?

- Rename all instances of Statuseable in the codebase, to HasStatus
- Rename all files from statuseable to has_status

## What are the relevant issue numbers?

Closes #21103 

See merge request !6003
parents 1cc59ffe 23bed91b
module Ci module Ci
class Pipeline < ActiveRecord::Base class Pipeline < ActiveRecord::Base
extend Ci::Model extend Ci::Model
include Statuseable include HasStatus
self.table_name = 'ci_commits' self.table_name = 'ci_commits'
......
class CommitStatus < ActiveRecord::Base class CommitStatus < ActiveRecord::Base
include Statuseable include HasStatus
include Importable include Importable
self.table_name = 'ci_builds' self.table_name = 'ci_builds'
......
module Statuseable module HasStatus
extend ActiveSupport::Concern extend ActiveSupport::Concern
AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped] AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped]
......
...@@ -34,7 +34,7 @@ module Ci ...@@ -34,7 +34,7 @@ module Ci
end end
def process_build(build, current_status) def process_build(build, current_status)
return false unless Statuseable::COMPLETED_STATUSES.include?(current_status) return false unless HasStatus::COMPLETED_STATUSES.include?(current_status)
if valid_statuses_for_when(build.when).include?(current_status) if valid_statuses_for_when(build.when).include?(current_status)
build.enqueue build.enqueue
......
require 'spec_helper' require 'spec_helper'
describe Statuseable do describe HasStatus do
before do before do
@object = Object.new @object = Object.new
@object.extend(Statuseable::ClassMethods) @object.extend(HasStatus::ClassMethods)
end end
describe '.status' do describe '.status' do
...@@ -12,7 +12,7 @@ describe Statuseable do ...@@ -12,7 +12,7 @@ describe Statuseable do
end end
subject { @object.status } subject { @object.status }
shared_examples 'build status summary' do shared_examples 'build status summary' do
context 'all successful' do context 'all successful' do
let(:statuses) { Array.new(2) { create(type, status: :success) } } let(:statuses) { Array.new(2) { create(type, status: :success) } }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment