On Tuesday, 4 October 2011 at 4:37 AM, Jon Leighton wrote:

> What about adding a :consistent option when opening a transaction? E.g.
>  
> # Rolls back record state if the transaction fails
> transaction do
>  ...
> end
>  
> # Doesn't roll back record state / keep references
> transaction(:consistent => false) do
>  ...
> end
>  
> Then, we could make the transaction around test runs be non-consistent?
Consistent is possibly the wrong word to use there though, as it's the C in 
ACID. I'm not sure I have a better suggestion though? :track_instance_state, 
:rollback_instances?  

fwiw it's not hard to construct cases where that per-instance rollback won't 
work, so relying on it is pretty … brave. My hunch is that the most common use 
case for maintaining that state (rather than just redirecting the user 
somewhere else) is for rendering a form with the user's data. I wonder if 
there's a cleaner / simpler solution to be found?

--  
Cheers,

Koz

-- 
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 rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to