Thanx for the response... I'm not sure if a failed validation would
cause a rollback.... since they don't raise an error. Unless you
called #save!, but if this were the case then failed calls to #save
would get past the rollback.

it is not the transactions job to rollback an #invalid? record ....
that record should not have started the save process at all.

b = Book.new
b.author = @author


b.valid? will call @author.valid? if told to by the relevent
validation method on Book


> > and can I start an
> > agrument about allowing validations to occur *before* the
> > transactions!

hehe..

now for my _real_ reason :)

I'm throwing errors around during some of my own validations, and I'm
managing to break the transaction system (it's getting confused
because it thinks it should rollback - when it shouldn't)

after I looked around a bit I thought that what solves my problem
[doing validation before starting a transaction], is actually slightly
cleaner anyway...... unless there is some reason I'm blind to for
having validation within the transaction?





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to