Haven't submitted a patch for the fixture thing but I have for
nested transactions. I'll provide the hotpatch but I don't
know how it would behave without my nested transactions patch.

This should go into config/initializers/
so it's like a plugin but only the ruby code.
http://tarmo.itech.ee/fixtures_improvement.rb

If you're using the arnesttransacts [1] plugin then you should
probably overwrite it's lib/nested_transactions.rb file with this:
http://tarmo.itech.ee/nested_transactions.rb

If you're interested I've also changed the redhillonrails_core plugin
so all foreign keys created by it are deferrable by default, to make
this happen you just have to add 'sql << " DEFERRABLE"' to the
to_sql method in the plugins foreign_key_definition.rb file.

Oh, and for specifying the fixtures, it's enough to just do it in
test_helper.rb in whatever order. I'm not sure what happens exactly
if some tests add some fixtures that test_helper.rb does not.

As a warning, one minor downside with this approach is that if the
fixtures contain FK violations then the tests are still run but all
of them fail with an error and the error is not shown until all
testcases are ran.


[1] http://rubyforge.org/projects/arnesttransacts/

On P, 2007-07-29 at 21:39 -0700, pedz wrote:
> So, did you submit this as a patch?  It seems to solve my issue and it
> solves a lot of other issues as well.
> 
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
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