Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-07-25 13:18:30 +0400
committerNihad Abbasov <narkoz.2008@gmail.com>2012-07-25 13:18:30 +0400
commit1b95c8bff351f6718ec31ac1de1e48c57bc95d44 (patch)
treeed06aacfa6dbaece68089b289cbfca07d8dbd43c /lib
parent92d98f5a0c28bffd7b070cda190b07ab72667d58 (diff)
API: ability to get project by id
Diffstat (limited to 'lib')
-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!