Skip to content

Instantly share code, notes, and snippets.

@ahmdrefat
Created October 21, 2012 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmdrefat/3926330 to your computer and use it in GitHub Desktop.
Save ahmdrefat/3926330 to your computer and use it in GitHub Desktop.
def get_full_profile
fprofile = FullProfile.find_by_user_id(current_user.id)
if fprofile.nil?
client = get_client
full_profile = client.profile(:fields => [:associations, :honors, :interests])
full_profile = full_profile.to_hash
new_full_profile = FullProfile.new(full_profile)
new_full_profile.user = current_user
new_full_profile.save
new_full_profile
else
fprofile
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment