BigW Consortium Gitlab

Commit 66b91ce9 by Lin Jen-Shin
parent 5b227f35
...@@ -17,11 +17,11 @@ class CommitStatus < ActiveRecord::Base ...@@ -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) }
......
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