提交 fed1c980 编写于 作者: A Andrey Vakarev

Refactoring: get rid of ruby antipattern unless/else and use if/else instead

上级 f33cf247
......@@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base
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
else
@ref = params[:ref]
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册