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

Fix specs for MySQL

parent 8c93b605
...@@ -8,8 +8,6 @@ module Ci ...@@ -8,8 +8,6 @@ module Ci
has_many :builds, class_name: 'Ci::Build' has_many :builds, class_name: 'Ci::Build'
has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest' has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest'
delegate :stages, to: :statuses
validates_presence_of :sha validates_presence_of :sha
validates_presence_of :status validates_presence_of :status
validate :valid_commit_sha validate :valid_commit_sha
...@@ -22,7 +20,8 @@ module Ci ...@@ -22,7 +20,8 @@ module Ci
end end
def self.stages 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 end
def project_id def project_id
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
%tbody %tbody
%th ID %th ID
%th Commit %th Commit
- @pipelines.stages.each do |stage| - stages.each do |stage|
%th %th
%span.has-tooltip(title="#{stage.titleize}") %span.has-tooltip(title="#{stage.titleize}")
= truncate(stage.titleize.pluralize, length: 8) = 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