summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-07-25 02:18:30 -0700
committerNihad Abbasov <narkoz.2008@gmail.com>2012-07-25 02:18:30 -0700
commit1b95c8bff351f6718ec31ac1de1e48c57bc95d44 (patch)
treeed06aacfa6dbaece68089b289cbfca07d8dbd43c /lib/api
parent92d98f5a0c28bffd7b070cda190b07ab72667d58 (diff)
downloadgitlab-ce-1b95c8bff351f6718ec31ac1de1e48c57bc95d44.tar.gz
API: ability to get project by id
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/helpers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index e7b9a417b08..4dfe35f49ef 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -5,7 +5,8 @@ module Gitlab
end
def user_project
- @project ||= current_user.projects.find_by_code(params[:id])
+ @project ||= current_user.projects.find_by_id(params[:id]) ||
+ current_user.projects.find_by_code(params[:id])
end
def authenticate!