diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-22 11:04:56 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-22 11:04:56 -0800 |
commit | 4d56c359d343ba3a1117dfc06034820a415450d3 (patch) | |
tree | 40232c2176dc8f46e7ab96de0bd45c1bc2934173 /lib/api/helpers.rb | |
parent | 1018cbdc803d56e6cae385aee97aa04752d3e3fb (diff) | |
parent | a3f645ef51ec12ce93934b4ddb11313613d8c451 (diff) | |
download | gitlab-ce-4d56c359d343ba3a1117dfc06034820a415450d3.tar.gz |
Merge pull request #6075 from skv-headless/remove_deprecated_finders
Remove deprecated finders
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 |