Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jay Levitt
Jim Deville wrote: >> > > Just wondering about your usage of constraints. We ran into this > issue recently and came to the conclusion that unless profiling shows > an issue, use AR to enforce referential integrity. You might be able > to get by using :dependent => :destroy, or one of the o

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jay Levitt
David Chelimsky wrote: > On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: >> Tilmann Singer wrote: >>> * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: What's rake doing differently? >>> rake spec isn't doing anything fundamentally different, but the order >>> the specs are run is propably

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Ben Mabey
As people have pointed out, using DB foreign key constraints within rails can be a nightmare when it comes to fixtures. In the past when I have used DB constraints I have always disabled the constraints when loading the fixtures so it wouldn't be an issue. The way I did it was the following:

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jim Deville
On Aug 27, 2007, at 8:08 AM, David Chelimsky wrote: > On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: >> Tilmann Singer wrote: >>> * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: What's rake doing differently? >>> >>> rake spec isn't doing anything fundamentally different, but the >>>

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread David Chelimsky
On 8/27/07, Jay Levitt <[EMAIL PROTECTED]> wrote: > Tilmann Singer wrote: > > * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: > >> What's rake doing differently? > > > > rake spec isn't doing anything fundamentally different, but the order > > the specs are run is propably randomly different fro

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Jay Levitt
Tilmann Singer wrote: > * Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: >> What's rake doing differently? > > rake spec isn't doing anything fundamentally different, but the order > the specs are run is propably randomly different from when you run > them with spec so they happen to pass in one

Re: [rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-27 Thread Tilmann Singer
* Jay Levitt <[EMAIL PROTECTED]> [20070827 03:51]: > I've got a spec that loads a fixture in the "before" block. This works > fine running scripts/spec, but when I run rake spec instead, I get: > > ActiveRecord::StatementInvalid in 'User in fixture :quentin with an IM > service but no IM name s

[rspec-users] Foreign key constraints, fixtures, and rake task

2007-08-26 Thread Jay Levitt
I've got a spec that loads a fixture in the "before" block. This works fine running scripts/spec, but when I run rake spec instead, I get: ActiveRecord::StatementInvalid in 'User in fixture :quentin with an IM service but no IM name should be invalid' Mysql::Error: Cannot delete or update a par