summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:47:47 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:47:47 -0500
commit865e8853369b542569693ec23a9b533481228829 (patch)
tree99a9557868fc53ce6d328a12300d0268f0d6fa39 /app/models/ci/commit.rb
parent8c93b6051fdc7bb59af2e6bf2f5b3a1817a73ceb (diff)
downloadgitlab-ce-865e8853369b542569693ec23a9b533481228829.tar.gz
Fix specs for MySQL
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r--app/models/ci/commit.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 91c5b4c1cae..6675a3f5d53 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -8,8 +8,6 @@ module Ci
has_many :builds, class_name: 'Ci::Build'
has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest'
- delegate :stages, to: :statuses
-
validates_presence_of :sha
validates_presence_of :status
validate :valid_commit_sha
@@ -22,7 +20,8 @@ module Ci
end
def self.stages
- CommitStatus.where(commit: all).stages
+ # We use pluck here due to problems with MySQL which doesn't allow LIMIT/OFFSET in queries
+ CommitStatus.where(commit: pluck(:id)).stages
end
def project_id