Commit 865e8853 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix specs for MySQL

parent 8c93b605
......@@ -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
......
......@@ -55,7 +55,7 @@
%tbody
%th ID
%th Commit
- @pipelines.stages.each do |stage|
- stages.each do |stage|
%th
%span.has-tooltip(title="#{stage.titleize}")
= truncate(stage.titleize.pluralize, length: 8)
......
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