Commit 13d009ce authored by Lin Jen-Shin's avatar Lin Jen-Shin

Prefer oneline and Rubocop prefers ternary operator

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8286/diffs#note_20433402
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