Commit 09831488c9be082f424c774e8eecd3f002dbae37

Authored by Dmitriy Zaporozhets
2 parents 8943714c fed1c980

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
Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
app/controllers/application_controller.rb
@@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base @@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base
97 end 97 end
98 98
99 def load_refs 99 def load_refs
100 - unless params[:ref].blank?  
101 - @ref = params[:ref]  
102 - else 100 + if params[:ref].blank?
103 @branch = params[:branch].blank? ? nil : params[:branch] 101 @branch = params[:branch].blank? ? nil : params[:branch]
104 @tag = params[:tag].blank? ? nil : params[:tag] 102 @tag = params[:tag].blank? ? nil : params[:tag]
105 @ref = @branch || @tag || @project.try(:default_branch) || Repository.default_ref 103 @ref = @branch || @tag || @project.try(:default_branch) || Repository.default_ref
  104 + else
  105 + @ref = params[:ref]
106 end 106 end
107 end 107 end
108 108