[Rails] Re: fail rollback transaction with manual raise exception

2010-07-26 Thread Carlos Forero
I'm sorry. The problem was the following code that another developer had added: class ApplicationController < ActionController::Base prepend_around_filter :action_transaction def action_transaction ActiveRecord::Base.transaction do yield end end end thanks anyway -- You re

[Rails] Re: fail rollback transaction with manual raise exception

2010-07-23 Thread Carlos Forero
Yes I tried 'raise ActiveRecord::Rollback' without '.new', but i have the same problem. On Jul 23, 3:37 pm, Me wrote: > Did you try 'raise ActiveRecord::Rollback' ? > > without the .new > > On Jul 23, 1:38 pm, Carlos Forero wrote: > > >

[Rails] Re: fail rollback transaction with manual raise exception

2010-07-23 Thread Carlos Forero
ethod to rollback the database transaction and pass on the exception" On Jul 23, 1:06 pm, Me wrote: > save! just throws an error if there is an issue.  Do you have > validations that are supposed to cause an exception in that case? > > On Jul 23, 10:45 am, Carlos Forero wrote: > >

[Rails] fail rollback transaction with manual raise exception

2010-07-23 Thread Carlos Forero
With : PostgreSQL 8.4 or postgresql-8.3 rails 2.3.4 pg 9.x or pg 8.x I test this code: = class NkiBatch < ActiveRecord::Base Bank.connection.transaction do bank = Bank.new(:name => "ddsjdsjdsjk") bank.save! raise ActiveRecord::Rollback.new e