# \[ANN\] fixture\_dependencies plugin

**URL:** <https://www.ruby-forum.com/t/ann-fixture-dependencies-plugin/122358>\
**Category:** Rails\
**Created:** [December 6, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/ann-fixture-dependencies-plugin/122358 "2007-12-06T22:51:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerdmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c68b51/32.png) [@nerdmaster](https://www.ruby-forum.com/u/nerdmaster)\
**Post date:** [December 6, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/ann-fixture-dependencies-plugin/122358/1 "2007-12-06T22:51:25Z")

</div>

fixture\_dependencies is a plugin that changes the way Rails uses  
fixtures in  
the following ways:

- Fixtures can specify associations instead of foreign keys
- Supports belongs\_to, has\_many, has\_one, and habtm associations
- Loads a fixture’s dependencies (associations with other fixtures)  
before the  
fixture itself so that foreign key constraints aren’t violated
- Can specify individual fixtures to load per test or test suite
- Loads fixtures on every test inside a transaction, so fixture  
information  
is never left in your database
- Handles almost all cyclic dependencies

To use, first install the plugin, then add the following to  
test/test\_helper.rb after “require ‘test\_help’”:

require ‘fixture\_dependencies\_test\_help’

This overrides the default test helper to load the fixtures inside  
transactions  
and to use FixtureDependencies to load the fixtures.

fixture\_dependencies is available via http and svn:

svn: svn://code.jeremyevans.net/rails-plugins/fixture\_dependencies  
file: [http://code.jeremyevans.net/code/fixture\_dependencies.tar.gz](http://code.jeremyevans.net/code/fixture_dependencies.tar.gz)

RDoc for the plugin is available at:

[http://code.jeremyevans.net/doc/fixture\_dependencies/](http://code.jeremyevans.net/doc/fixture_dependencies/)

Enjoy,  
Jeremy
