Skip to content

Commit

Permalink
remove useless if else
Browse files Browse the repository at this point in the history
  • Loading branch information
CBElizabeth committed Apr 21, 2015
1 parent fbacb70 commit 6d22c56
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ def create
end

def show
user = User.find(params[:id])
user = User.find(auth0_id: params[:auth0_id])
render json: user.to_json
end

def update
user = User.find(params[:id])
if user.update(params)
render json: user.to_json
else
render json: user.to_json
user = User.find_by(auth0_id: params[:auth0_id])
user.update(params)
render json: user.to_json
end

end

0 comments on commit 6d22c56

Please sign in to comment.