gitlab-org--gitlab-foss/lib/constraints/user_url_constrainer.rb
Dmitriy Zaporozhets 42c6555bab Make user constrainer lookup same as controller and add more constrainer tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-06 19:50:48 +03:00

7 lines
187 B
Ruby

require 'constraints/namespace_url_constrainer'
class UserUrlConstrainer < NamespaceUrlConstrainer
def find_resource(id)
User.find_by('lower(username) = ?', id.downcase)
end
end