BigW Consortium Gitlab

Commit 13d009ce by Lin Jen-Shin

Prefer oneline and Rubocop prefers ternary operator

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