Skip to content

Commit

Permalink
Merge branch 'master' of github.com:thinchat/thin_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
thejonanshow committed Jun 12, 2012
2 parents a3f26ff + 804b991 commit 1ea21a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 5 additions & 6 deletions app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
class Api::V1::UsersController < ApplicationController
respond_to :json

def show
@user = User.where(id: params[:id].to_s).first
if @user
render :json => @user.to_json
if @user = User.where(id: params[:id].to_s).first
respond_with @user
else
render :json => {:error => "user not found"}.to_json, :status => 404
render :json => {:error => "User not found."}, :status => :not_found
end
end

end
end
4 changes: 0 additions & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ def self.approved_email?(email)
domain = email.split('@').last
ACCEPTED_DOMAINS.include? domain
end

def to_json
super(:except => :password)
end
end

0 comments on commit 1ea21a3

Please sign in to comment.