Commit 63c319bb authored by Alex Kalderimis's avatar Alex Kalderimis Committed by Douglas Barbosa Alexandre

Predicate methods should return booleans, not strings

This change ensures that the method `complete` actually returns a
boolean, rather than a possibly nil string.
parent 98272880
...@@ -37,7 +37,7 @@ module Gitlab ...@@ -37,7 +37,7 @@ module Gitlab
# We have `base_sha` directly available on `DiffRefs` because it's faster# # We have `base_sha` directly available on `DiffRefs` because it's faster#
# than having to look it up in the repo every time. # than having to look it up in the repo every time.
def complete? def complete?
start_sha && head_sha start_sha.present? && head_sha.present?
end end
def compare_in(project) def compare_in(project)
......
...@@ -23,7 +23,7 @@ module Gitlab ...@@ -23,7 +23,7 @@ module Gitlab
end end
def complete? def complete?
x && y && width && height [x, y, width, height].all?(&:present?)
end end
def to_h def to_h
......
...@@ -19,7 +19,7 @@ module Gitlab ...@@ -19,7 +19,7 @@ module Gitlab
end end
def complete? def complete?
old_line || new_line old_line.present? || new_line.present?
end end
def to_h def to_h
......
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