Skip to content

Instantly share code, notes, and snippets.

@mh-github
Created July 30, 2012 11:35
Show Gist options
  • Save mh-github/3206341 to your computer and use it in GitHub Desktop.
Save mh-github/3206341 to your computer and use it in GitHub Desktop.
def accept_connection = {
def user1 = session.user.attach()
user1.connections_requested_by.remove(params.profile_username)
user1.connections.add(profile_username)
user1.save()
User user2 = User.findByUsername(params.profile_username)
user2.connections.requested_to.remove(user1.username)
user2.save()
render (template: 'accept-connection')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment