diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-08 15:26:08 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-20 16:32:29 +0300 |
commit | 21f3e9ce2617b8869583bdae60cc619bcd0a29bd (patch) | |
tree | 8aecc2f70d260a37da98a8baea2fb4912a10443b /app/models | |
parent | 64e09a1b35cc1897df7e46e73989c6e7013f6196 (diff) |
Move custom compound status method to commit status
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/commit_status.rb | 6 | ||||
-rw-r--r-- | app/models/concerns/has_status.rb | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 07cec63b939..500d05fd840 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -103,6 +103,12 @@ class CommitStatus < ActiveRecord::Base end end + def self.status + super.tap do |status| + return 'success' if status == 'skipped' && all.failed_but_allowed.any? + end + end + def locking_enabled? status_changed? end diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb index 692bd1f9317..3c9c6584e02 100644 --- a/app/models/concerns/has_status.rb +++ b/app/models/concerns/has_status.rb @@ -37,9 +37,7 @@ module HasStatus end def status - all.pluck(status_sql).first.tap do |status| - return 'success' if status == 'skipped' && all.failed_but_allowed.any? - end + all.pluck(status_sql).first end def started_at |