Displaying 1 result from an estimated 1 matches for "dunkerstr".
Did you mean:
duererstr
2006 Jan 26
1
Transactions for multiple models
I have users and companies tables where users belongs_to companies.
def signup
@company = Company.new(params[:company])
@user = User.new(params[:company])
@user.company = @company
if @user.valid? and @company.valid?
@company.save
@user.save
end
end
How can I make this into a transaction? Is this a candidate for a
distributed transaction?
If so, from what I understand from the API,