Commit fed1c9804744fa20bfda47d269a4b0b566754ba3

Authored by Andrey Vakarev
1 parent f33cf247

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