Skip to content

Instantly share code, notes, and snippets.

@ckentq
Created May 10, 2013 03:04
Show Gist options
  • Save ckentq/5552160 to your computer and use it in GitHub Desktop.
Save ckentq/5552160 to your computer and use it in GitHub Desktop.
u = User.find_by_fbid(params[:fbid])
u = User.find_by_email(params[:email])
if u.nil?
render :json=>{:user_id=>,:user_email=>}
else
render :json=>{:user_id=>0,:user_email=>""}
end
@ckentq
Copy link
Author

ckentq commented May 10, 2013

u = User.find_by_fbid(params[:fbid])

u = User.find_by_email(params[:email]) if u.nil? and params[:email].presence

if u.nil?
  render :json=>{:user_id=>u.id,:user_email=>params[:email]}
else
  render :json=>{:user_id=>0,:user_email=>""}
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment