summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorJavier Castro <javier.alejandro.castro@gmail.com>2014-03-04 15:09:33 -0300
committerJavier Castro <javier.alejandro.castro@gmail.com>2014-03-04 15:09:33 -0300
commitb61f80babb10d0583d3199d557b4e8234d981a33 (patch)
tree747f124631f6547103bd30d4b48586382b91ae89 /lib/api/helpers.rb
parent556ae5ae8187b89a3785219d5621e7ebc9bb7a8c (diff)
parentfbbd989770ea48d472a5c4d7d95b970542279099 (diff)
downloadgitlab-ce-b61f80babb10d0583d3199d557b4e8234d981a33.tar.gz
Merge remote-tracking branch 'upstream/master' into fix-4305
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index b0f8d5a6da9..f8c48e2f3b2 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -7,7 +7,7 @@ module API
def current_user
private_token = (params[PRIVATE_TOKEN_PARAM] || env[PRIVATE_TOKEN_HEADER]).to_s
- @current_user ||= User.find_by_authentication_token(private_token)
+ @current_user ||= User.find_by(authentication_token: private_token)
identifier = sudo_identifier()
# If the sudo is the current user do nothing
@@ -47,7 +47,7 @@ module API
end
def find_project(id)
- project = Project.find_by_id(id) || Project.find_with_namespace(id)
+ project = Project.find_by(id: id) || Project.find_with_namespace(id)
if project && can?(current_user, :read_project, project)
project