From a827acb281e67669f131ce95a45ceca56e0699ea Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Tue, 19 Jul 2016 22:14:42 +0100 Subject: altered the exists action to avoid 404ing --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7ce4a75ffc1..6931a553205 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,6 @@ class UsersController < ApplicationController skip_before_action :authenticate_user! - before_action :user + before_action :user, except: [:exists] before_action :authorize_read_user!, only: [:show] def show @@ -86,7 +86,7 @@ class UsersController < ApplicationController end def exists - render json: { exists: !user.nil? } + render json: { exists: !User.find_by_username(params[:username]).nil? } end private -- cgit v1.2.1