Skip to content

Instantly share code, notes, and snippets.

@Ravenna
Created January 13, 2012 17:12
Show Gist options
  • Select an option

  • Save Ravenna/1607575 to your computer and use it in GitHub Desktop.

Select an option

Save Ravenna/1607575 to your computer and use it in GitHub Desktop.
associate method
def associate_correct_user
new_user = User.find_or_create_by_email self.email do |u|
user = Email.find_by_email(self.email)
u.first_name = user.first_name
u.last_name = user.last_name
u.invite!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment