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
This commit is contained in:
Dmitriy Zaporozhets 2012-05-20 01:02:14 -07:00
commit 09831488c9

View file

@ -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