diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 91c5b4c1cae40dc4dc7ec72e718bcc3a7cdcca1b..6675a3f5d53fefe8de92d372ed093fe16bc2a316 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 diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index 574941ed5f28056b67fec42f2361e42a150f5c34..af55ef42a6e10b766fb93905486fd562ae4b5889 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -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)