mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-26 09:04:07 +01:00
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:
parent
36fcfe5c59
commit
ce2a9e2279
5 changed files with 5 additions and 5 deletions
|
|
@ -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'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue