Minor refactor to preare for arRESTing NoteController.

Also fixed a recently introduced bug that caused projects or contexts with numbers in the name to fail to resolve properly by URL
 


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@401 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-01-14 19:33:11 +00:00
parent 36fcfe5c59
commit ce2a9e2279
5 changed files with 5 additions and 5 deletions

View file

@ -100,7 +100,7 @@ class ContextsController < ApplicationController
def check_user_set_context
if params['url_friendly_name']
@context = @user.contexts.find_by_url_friendly_name(params['url_friendly_name'])
elsif params['id'] && params['id'] =~ /\d+/
elsif params['id'] && params['id'] =~ /^\d+$/
@context = @user.contexts.find(params['id'])
elsif params['id']
@context = @user.contexts.find_by_url_friendly_name(params['id'])