Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-20 12:02:14 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-20 12:02:14 +0400
commit09831488c9be082f424c774e8eecd3f002dbae37 (patch)
treeec8320e59a2e8d93d014ccd7d1a23f60a3259471
parent8943714cdfe45ad5c5e2031af04fd823d6221f52 (diff)
parentfed1c9804744fa20bfda47d269a4b0b566754ba3 (diff)
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
-rw-r--r--app/controllers/application_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 17bcef4bb23..8dd407ac16b 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -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