diff options
author | zenati <zenati@users.noreply.github.com> | 2015-06-08 19:01:50 +0300 |
---|---|---|
committer | zenati <zenati@users.noreply.github.com> | 2015-06-08 19:01:50 +0300 |
commit | c418261b2bd3eb3754fe0625fd07484a8fc32d9d (patch) | |
tree | 1add3618a6f3575ad0d983de6f8dc2a71f1b1731 | |
parent | 509fe1159a76f325840987bd3d1a1db577569772 (diff) |
No need to check if `repository_ref` is present
There is no need to check if `repository_ref` is present as:
```
@repository_ref = if repository_ref.present?
repository_ref
else
nil
end
```
is as same as doing:
```
@repository_ref = repository_ref
```
-rw-r--r-- | lib/gitlab/project_search_results.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb index 0dab7bcfa4d..581a8c20bdb 100644 --- a/lib/gitlab/project_search_results.rb +++ b/lib/gitlab/project_search_results.rb @@ -4,11 +4,7 @@ module Gitlab def initialize(project_id, query, repository_ref = nil) @project = Project.find(project_id) - @repository_ref = if repository_ref.present? - repository_ref - else - nil - end + @repository_ref = repository_ref @query = Shellwords.shellescape(query) if query.present? end |