Just released a new version of the Managed Fixtures plugin, previously
known as Export Fixtures.
The name change comes with some added functionality for managing the
fixtures, primarily with two new import tasks for importing specific
Models
or all of them within the test/fixtures directory.
Both new import tasks take the exported fixtures, and allow you to
directly
import one, or all of them.
= Description
This plugin is a super lightweight tool used to manage all your
fixtures,
whether it is exporting or importing them.
So if you want to export all your data from your production server into
your
development environment, this will simplify the process without having
to
load up your database manager.
Similarly, if you want to import a selected set of Models, you can do
that
using the appropriate tasks.
= INSTALLATION
[%] script/plugin discover
[%] script/plugin install manage_fixtures
= USAGE
Create YAML test fixtures from data in an existing database. Defaults to
development database. Set RAILS_ENV to override.
[%] rake db:fixtures:export_all
Create YAML test fixtures for a specific table(s) from data in an
existing
database. Defaults to development database. Set RAILS_ENV to override.
[%] rake db:fixtures:export_for_tables TABLES=foos[,bars]
Create YAML text fixtures based on a specific SQL query
[%] rake db:fixtures:export_using_query SQL=“select * from foo where
id=‘bar’” FIXTURE_NAME=foo
Import the YAML test fixtures for specific models from data in an
existing
database. Defaults to development database. Set RAILS_ENV to override.
[%] rake db:fixtures:import_for_models MODELS=Foo[,Bar,Land]
Import all YAML test fixtures for all of the models from data in an
existing
database. Defaults to development database. Set RAILS_ENV to override.
[%] rake db:fixtures:import_all