Commit 09831488 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #837 from avakarev/get-rid-of-ruby-antipattern-unless-else

Refactoring: get rid of ruby antipattern unless/else and use if/else instead
parents 8943714c fed1c980
...@@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment