Tony Byrne wrote:
> Hi Jaime,
> 
> On 13 Aug 2010, at 11:49, Jaime Ferreira wrote:
> 
>> How is it possible that the fixtures loading go around my database
>> constraints?
> 
> For PostgreSQL AFAIK, the triggers which enforce RI are disabled prior 
> to the loading of the fixtures.  I only discovered this because I ran 
> into a problem recently where my tests were failing because the db user 
> for the tests did not have permissions to disable the triggers.

Oh, right...I remember seeing that (I think it's a performance hack?). 
Yet another reason not to use fixtures, arguably the most broken and 
horrific feature of Rails.  Jaime, I would *highly* recommend abandoning 
fixtures and using factories for your testing instead (I like Machinist 
for this).  Your tests will be easier to write and more conceptually 
correct.

> 
> Regards,
> 
> Tony Byrne.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en.

Reply via email to