Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8ff384c15ea9
Commit
8ff384c1
authored
May 20, 2012
by
Andrey Vakarev
Browse files
Refactoring: get rid of ruby antipattern unless/else and use if/else instead
parent
bb8d987f21d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/application_controller.rb
View file @
8ff384c1
...
...
@@ -97,9 +97,7 @@
end
def
load_refs
unless
params
[
:ref
].
blank?
@ref
=
params
[
:ref
]
else
if
params
[
:ref
].
blank?
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@ref
=
@branch
||
@tag
||
@project
.
try
(
:default_branch
)
||
Repository
.
default_ref
...
...
@@ -103,6 +101,8 @@
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@ref
=
@branch
||
@tag
||
@project
.
try
(
:default_branch
)
||
Repository
.
default_ref
else
@ref
=
params
[
:ref
]
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment