diff options
Diffstat (limited to 'lib/constraints/user_url_constrainer.rb')
-rw-r--r-- | lib/constraints/user_url_constrainer.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/constraints/user_url_constrainer.rb b/lib/constraints/user_url_constrainer.rb index 504a0f5d93e..9ab5bcb12ff 100644 --- a/lib/constraints/user_url_constrainer.rb +++ b/lib/constraints/user_url_constrainer.rb @@ -1,7 +1,5 @@ -require 'constraints/namespace_url_constrainer' - -class UserUrlConstrainer < NamespaceUrlConstrainer - def find_resource(id) - User.find_by('lower(username) = ?', id.downcase) +class UserUrlConstrainer + def matches?(request) + User.find_by_username(request.params[:username]).present? end end |