Refactoring: get rid of ruby antipattern unless/else and use if/else instead
This commit is contained in:
parent
f33cf247b6
commit
fed1c98047
|
@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_refs
|
def load_refs
|
||||||
unless params[:ref].blank?
|
if params[:ref].blank?
|
||||||
@ref = params[:ref]
|
|
||||||
else
|
|
||||||
@branch = params[:branch].blank? ? nil : params[:branch]
|
@branch = params[:branch].blank? ? nil : params[:branch]
|
||||||
@tag = params[:tag].blank? ? nil : params[:tag]
|
@tag = params[:tag].blank? ? nil : params[:tag]
|
||||||
@ref = @branch || @tag || @project.try(:default_branch) || Repository.default_ref
|
@ref = @branch || @tag || @project.try(:default_branch) || Repository.default_ref
|
||||||
|
else
|
||||||
|
@ref = params[:ref]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue