Populating the development database

Hey guys,

Is there an easy way for me to take my test fixtures and pop them
into my development database? I really don’t want to use the
interface to populate the database… it takes too much time.

Adam

On Thu, 2005-11-17 at 13:31 -0800, Adam van den Hoven wrote:

Hey guys,

Is there an easy way for me to take my test fixtures and pop them
into my development database? I really don’t want to use the
interface to populate the database… it takes too much time.

Adam

Indeed… in one of our recent projects, Jeremy added this as a
development task:

lib/tasks/development.rake

desc ‘Load fixtures into the development database for convenience.’
task :development => [:environment] do
require ‘active_record/fixtures’
Fixtures.create_fixtures “#{RAILS_ROOT}/test/fixtures”,
%w( languages projects translations )
end

rake development.

Voila. :slight_smile:

-Robby


/******************************************************

On 11/17/05, Robby R. [email protected] wrote:

development task:
rake development.

Voila. :slight_smile:

And if it’s not clear, the languages, projects, and translations are
the fixtures that should be loaded into the development database.

end

rake development.

Voila. :slight_smile:

That’s nice, but there’s already rake load_fixtures for that :slight_smile:


rick
http://techno-weenie.net

Indeed so much has changed, and that task has a history dating back
to the first RailsDay.

I find variations on that theme to be useful for importing just
certain fixtures, however, such as country or language data that are
needed to initialize a system… it lets you take what you need.

On Nov 17, 2005, at 4:14 PM, Rick O. wrote:

end


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

/******************************************************

Also Cokemachineglow | www.cokemachineglow.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rick O. wrote:

That’s nice, but there’s already rake load_fixtures for that :slight_smile:

How about the otherdirection: I have some test dat I want to put in a
yaml file,
but don’t want to type it all…


David M.
Maia Mailguard - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDfhu4SIxC85HZHLMRAiRAAJ9pAiju1amH37z2zbHyILJSoTl2dACfV7wD
qfWZfLqAyG5PuMGs81y7C9Q=
=7JHs
-----END PGP SIGNATURE-----