Created
February 4, 2009 00:20
-
-
Save mjfreshyfresh/57846 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :data do | |
desc "load in some basic data [caution: will nuke and replcace categories, categorizations and inventory items]" | |
task :bootstrap => :environment do | |
# clean out existing: | |
[Category, Categorization, InventoryItem].each{|m| m.find(:all).each{|i| i.destroy}} | |
InventoryItem.create! :name => "Compass" | |
c = Category.create! :name => "Basic Apparel" | |
["Men’s Heavyweight Cotton T", | |
"Men’s Heavyweight Polo", | |
"Women’s Organic Cotton Fitted T", | |
"Women’s Fitted Polo", | |
"Children’s T-Shirt", | |
"Jr’s Distressed Hoodie", | |
"Hemp Messenger Bag"].each do |name| | |
c.inventory_items.create! :name => name | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment