Skip to content
Snippets Groups Projects
Commit 66b91ce9 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files
parent 5b227f35
No related branches found
No related tags found
1 merge request!5142Add a download buttons for Build Artifacts
Loading
@@ -17,11 +17,11 @@ class CommitStatus < ActiveRecord::Base
Loading
@@ -17,11 +17,11 @@ class CommitStatus < ActiveRecord::Base
alias_attribute :author, :user alias_attribute :author, :user
   
scope :latest, -> do scope :latest, -> do
id = unscope(:select). max_id = unscope(:select).
select("max(#{table_name}.id)"). select("max(#{table_name}.id)").
group(:name, :commit_id) group(:name, :commit_id)
   
where(id: id) where(id: max_id)
end end
scope :retried, -> { where.not(id: latest) } scope :retried, -> { where.not(id: latest) }
scope :ordered, -> { order(:name) } scope :ordered, -> { order(:name) }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment