Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created September 24, 2010 17:54
Show Gist options
  • Save carllerche/595754 to your computer and use it in GitHub Desktop.
Save carllerche/595754 to your computer and use it in GitHub Desktop.
class Signup
has_one :account, :map => { :account_name => :name }
has_one :user
def on_save
account.save
user.save
Membership.create :user_id => user.id, account.id
end
end
signup = Signup.new :account_name => "omg"
if signup.save
raise lol
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment