On 20 Sep 2008, at 01:59, Scott Taylor wrote:
There's another approach though that I haven't tried yet. One of the
guys I work with truncates all the tables in the db before every
example. He says this runs as fast or faster than transactional
fixtures, and has the added benefit of NOT being
> We have a few lines of code in our features steps/env.rb that does this
>
> 1. patch AR to stash each AR object created in an array
> 2. in an After do block, call destroy on each of those objects.
>
> We can probably share if anyone would like to see this.
>
>
Please!
Best,
Todd
___
On Sep 20, 2008, at 6:31 AM, Matt Wynne wrote:
On 20 Sep 2008, at 01:59, Scott Taylor wrote:
There's another approach though that I haven't tried yet. One of
the
guys I work with truncates all the tables in the db before every
example. He says this runs as fast or faster than transactio
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
while table = result.fetch_row
# Or whatever you think is appropriate.
next if table.index('schema_migrat
"Todd Tyree" <[EMAIL PROTECTED]> writes:
> Ok, here's what I've come up with on the spur of the moment (goes in
> spec_helper.rb):
>
> config.after(:each) do
> result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
> while table = result.fetch_row
> # Or whatever you think i
On 20 Sep 2008, at 11:33, Todd Tyree wrote:
We have a few lines of code in our features steps/env.rb that does
this
1. patch AR to stash each AR object created in an array
2. in an After do block, call destroy on each of those objects.
We can probably share if anyone would like to see thi
Just to be clear, these methods of truncating tables or remembering rows to
delete are only useful in the presence of fixtures? Otherwise, the standard
transactional support is sufficient and (probably) faster, right? (if for no
other reason because it's all handled deep in the bowels of the db).
On Sep 20, 2008, at 8:08 AM, Todd Tyree wrote:
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
while table = result.fetch_row
# Or whatever you think is
"Mark Wilden" <[EMAIL PROTECTED]> writes:
> Just to be clear, these methods of truncating tables or remembering rows to
> delete are only useful in the presence of fixtures? Otherwise, the standard
> transactional support is sufficient and (probably) faster, right? (if for no
> other reason becaus
Todd Tyree wrote:
> Ok, here's what I've come up with on the spur of the moment (goes in
> spec_helper.rb):
>
> config.after(:each) do
> result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
> while table = result.fetch_row
> # Or whatever you think is appropriate.
> n
On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
Todd Tyree wrote:
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
while table = result.fetch_row
# Or whatever y
Scott Taylor wrote:
>
> On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
>
>> Todd Tyree wrote:
>>> Ok, here's what I've come up with on the spur of the moment (goes in
>>> spec_helper.rb):
>>>
>>> config.after(:each) do
>>>result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
>>>whil
Ben Mabey wrote:
> Scott Taylor wrote:
>
>> On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
>>
>>
>>> Todd Tyree wrote:
>>>
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Ba
On Sep 20, 2008, at 8:53 PM, Ben Mabey wrote:
Ben Mabey wrote:
Scott Taylor wrote:
On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
Todd Tyree wrote:
Ok, here's what I've come up with on the spur of the moment
(goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Bas
14 matches
Mail list logo