RubyGems Navigation menu

db_reference 0.0.5

Used for creating a predefined set of models, similar to db:seed, but will not repopulate if entries already exist. Place references in 'db/reference/' References will be loaded in ascending order, so if an order is desired, prepend 000, 001, 002... etc to the filename. Run with: rake reference:load Example ======= The below example ensures that there are 6 locations existing in the database after running the 'rake reference:load' # db/schema.rb create_table 'locations', :force => true do |t| t.string 'name', :null => false end # db/reference/000_locations.rb Location.update_or_create :id => 1, :name => 'Wellington City' Location.update_or_create :id => 2, :name => 'Lower Hutt' Location.update_or_create :id => 3, :name => 'Kapiti Coast' Location.update_or_create :id => 4, :name => 'Porirua' Location.update_or_create :id => 5, :name => 'Upper Hutt' Location.update_or_create :id => 6, :name => 'Wairarapa'

Gemfile:
= In die Zwischenablage kopieren Kopiert!

installieren:
=

Versionen:

  1. 0.1.0 - May 29, 2012 (6 KB)
  2. 0.0.8 - July 19, 2011 (6 KB)
  3. 0.0.7 - July 19, 2011 (6 KB)
  4. 0.0.6 - April 07, 2011 (6 KB)
  5. 0.0.5 - April 07, 2011 (6 KB)
Zeige alle Versionen (9 total)

Besitzer:

Autoren:

  • Cam Fowler

SHA 256-Prüfsumme:

6724932bf3ba64c71a7d10d8a523976857590b8579177f0f1d05821c4656a408

Downloads insgesamt 38.493

Für diese Version 3.710

Lizenzen:

k.A.

Erforderliche Ruby-Version: None

Links: