diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-12-16 14:58:59 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-10 01:01:34 +0300 |
commit | 866bb202f29b8f5ad52563dd48ae57168dc6df77 (patch) | |
tree | 745ff790a1b47a930283b389efd5e10fa5ad779b /app/finders/issuable_finder.rb | |
parent | b0d8d742c588baacf0ba08074f23e68498297d10 (diff) |
Check if it's not NONE too
So that we don't have to check it again in somewhere else,
and we don't really need to know if it's presented as NONE
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7345/diffs#note_20123999
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r-- | app/finders/issuable_finder.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 2afde8ece65..dfd7de6afa9 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -166,20 +166,20 @@ class IssuableFinder end def assignee_id? - params[:assignee_id].present? + params[:assignee_id].present? && params[:assignee_id] != NONE end def assignee_username? - params[:assignee_username].present? + params[:assignee_username].present? && params[:assignee_username] != NONE end def assignee return @assignee if defined?(@assignee) @assignee = - if assignee_id? && params[:assignee_id] != NONE + if assignee_id? User.find(params[:assignee_id]) - elsif assignee_username? && params[:assignee_username] != NONE + elsif assignee_username? User.find_by(username: params[:assignee_username]) else nil @@ -187,11 +187,11 @@ class IssuableFinder end def author_id? - params[:author_id].present? + params[:author_id].present? && params[:author_id] != NONE end def author_username? - params[:author_username].present? + params[:author_username].present? && params[:author_username] != NONE end def author |