Skip to content
Snippets Groups Projects
Commit 13d009ce authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Prefer oneline and Rubocop prefers ternary operator

parent b63f2794
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment