diff options
| author | Marin Jankovski <marin@gitlab.com> | 2014-01-24 14:02:11 +0100 |
|---|---|---|
| committer | Marin Jankovski <marin@gitlab.com> | 2014-01-24 14:02:11 +0100 |
| commit | 54bcb6cc2a863e10abdd76745d3a0d50c301ab77 (patch) | |
| tree | b374b46630cb1663ff8b6657a895b8087242fcfe /lib/api/helpers.rb | |
| parent | d819d0d1f84946bcc0d2c871682c220db6dbd478 (diff) | |
| parent | d1d138562a347ec78f0331d5242e28fbb368bad0 (diff) | |
| download | gitlab-ce-54bcb6cc2a863e10abdd76745d3a0d50c301ab77.tar.gz | |
Merge branch 'master' into reference_relative_links
Conflicts:
spec/models/project_spec.rb
Diffstat (limited to 'lib/api/helpers.rb')
| -rw-r--r-- | lib/api/helpers.rb | 4 |
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 |
