Forum: Ruby on Rails transaction is started before a validation [c/o Rails-Core]

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
20b1836f8acccd107b4992a1a45a14bd?d=identicon&s=25 chrisfarms (Guest)
on 2007-02-20 23:22
(Received via mailing list)
Hi all..

I was going to submit this as a bug...but thought I should learn more
first ...

When #save is called on an ActiveRecord a transaction is started to
catch any potential problems and try and recover from them.

This is cool.

But..

as a result of the Transaction module being mixed in quite late in the
game, the transactions system is one of the *first* things to get
initiated.........is the save_with_transaction system intentionally
called before the validations system?

It seems wasteful to begin the transactions block if the call to
#valid? simply returns false at the last minute?

Can anyone give me any insight into this system?, and can I start an
agrument about allowing validations to occur *before* the
transactions!

Thanks
This topic is locked and can not be replied to.