ActiveRecord::Rollback not found?

Hi All
The docs mention that raising ActiveRecord::Rollback from within a
‘transaction’ block causes the transaction to rollback without
reraising it. However, trying this in script/console gives this error:

NameError: uninitialized constant ActiveRecord::Rollback

Doing a recursive grep of /usr/lib/ruby doesn’t find any mention of
ActiveRecord::Rollback!! Am I doing something wrong? What’s the
‘right’ way to rollback a transaction explicitly from within a
‘transaction’ block?

thanks

On 29 Apr 2008, at 15:38, Praveen wrote:

Hi All
The docs mention that raising ActiveRecord::Rollback from within a
‘transaction’ block causes the transaction to rollback without
reraising it. However, trying this in script/console gives this error:

NameError: uninitialized constant ActiveRecord::Rollback

Well it’s defined in Activerecord’s base.rb (it just defined as class
Rollback (but inside the AR module) which is why your search didn’t
find it).
and ActiveRecord::Rollback seems to exist for me.

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs