X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dbe165bbb3d6eda37d9579f1ac767599f9055607..67e77fd20e2b75e353cc26d3f3b79e7e789be49c:/app/models/client_application.rb diff --git a/app/models/client_application.rb b/app/models/client_application.rb index e37629d17..11422e481 100644 --- a/app/models/client_application.rb +++ b/app/models/client_application.rb @@ -51,7 +51,7 @@ class ClientApplication < ActiveRecord::Base end def access_token_for_user(user) - unless token = access_tokens.valid.where(:user_id => user).first + unless token = access_tokens.valid.find_by(:user_id => user) params = { :user => user } permissions.each do |p|