Permalink
Browse files

Generalise #up to silently drop old parameters.

  • Loading branch information...
1 parent 4bf98dd commit 42aca55ad5ba4f3ddcba7864e4077134cc95eb82 @benhoskings committed Oct 20, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/controllers/bootstrap_controller.rb
@@ -1,7 +1,8 @@
class BootstrapController < ApplicationController
def up
- ref = (params[:ref] || '').sub(/^hard,?/, '').sub(/,?hard$/, '')
- ref = 'master' if ref.blank?
+ # This param used to be comma-separated options ('hard'/'next')
+ # but is now a ref, defaulting to 'master'.
+ ref = ((params[:ref] || '').split(',').push('master') - %w[hard next]).first
render action: 'up', layout: false, locals: {ref: ref}
end

0 comments on commit 42aca55

Please sign in to comment.