Forum: Ruby on Rails Populating the development database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
540acafebb6daddf6cc219facaf94ccd?d=identicon&s=25 AvandenHoven (Guest)
on 2005-11-17 22:32
(Received via mailing list)
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
B84d42a3a5c343f8fc6ab7d7f47fd3f5?d=identicon&s=25 robby.lists (Guest)
on 2005-11-17 23:12
(Received via mailing list)
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. :-)

-Robby

--
/******************************************************
* Robby Russell, Founder.Developer.Geek
* PLANET ARGON, Rails Development, Consulting & Hosting
* Portland, Oregon  | p: 503.351.4730 | f: 815.642.4068
* www.planetargon.com | www.robbyonrails.com
* Programming Rails   | www.programmingrails.com
*******************************************************/
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 joevandyk (Guest)
on 2005-11-18 00:24
(Received via mailing list)
On 11/17/05, Robby Russell <robby.lists@planetargon.com> wrote:
> development task:
> rake development.
>
> Voila. :-)

And if it's not clear, the languages, projects, and translations are
the fixtures that should be loaded into the development database.
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 technoweenie (Guest)
on 2005-11-18 01:16
(Received via mailing list)
> end
>
> rake development.
>
> Voila. :-)

That's nice, but there's already rake load_fixtures for that :)

--
rick
http://techno-weenie.net
C6a9988f5f021973d1642e806cdd174c?d=identicon&s=25 jeremy (Guest)
on 2005-11-18 01:25
(Received via mailing list)
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 Olson wrote:

>> end
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails

/******************************************************
  * Robby Russell, Founder.Developer.Geek
  * PLANET ARGON, Rails Development, Consulting & Hosting
  * Portland, Oregon  | p: 503.351.4730 | f: 815.642.4068
  * www.planetargon.com | www.jvoorhis.com
  * Refactoring Rails   | www.refactoringrails.com
  *******************************************************/

Also Cokemachineglow | www.cokemachineglow.com
235c58ad566abb4c7979bc7033e9882c?d=identicon&s=25 mortonda (Guest)
on 2005-11-18 19:23
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rick Olson wrote:

> That's nice, but there's already rake load_fixtures for that :)

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 Morton
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-----
This topic is locked and can not be replied to.