BigW Consortium Gitlab

Commit 13d009ce by Lin Jen-Shin

Prefer oneline and Rubocop prefers ternary operator

parent b63f2794
......@@ -93,13 +93,8 @@ module Ci
.select("max(#{quoted_table_name}.id)")
.group(:ref, :sha)
query = if ref
where(id: max_id, ref: ref)
else
where(id: max_id)
end
query.order(id: :desc)
relation = ref ? where(ref: ref) : self
relation.where(id: max_id).order(id: :desc)
end
def self.latest_status(ref = nil)
......
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