From a9f275bc201e666b9f26768aa228aca8250d5a94 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 5 Sep 2012 01:12:44 -0400 Subject: Fix load_refs in ApplicationController after default_branch change As a last resort it was calling a method that didn't exist. Woops! --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d53b23bb246..dae2e906256 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -124,7 +124,7 @@ class ApplicationController < ActionController::Base 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 + @ref = @branch || @tag || @project.try(:default_branch) || 'master' else @ref = params[:ref] end -- cgit v1.2.1 From 5e1c63d3f0f0729a1d9d9e19c64b2fef65cc30fb Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 5 Sep 2012 01:13:41 -0400 Subject: Move load_refs out of ApplicationController and into CommitsController That was the only place it was used. --- app/controllers/application_controller.rb | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index dae2e906256..7e53b8fe5ff 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -120,16 +120,6 @@ class ApplicationController < ActionController::Base end end - def load_refs - 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) || 'master' - else - @ref = params[:ref] - end - end - def render_404 render file: File.join(Rails.root, "public", "404"), layout: false, status: "404" end -- cgit v1.2.1