I have the following 003_load_orders_data file:
require 'active_record/fixtures'
class LoadOrdersData < ActiveRecord::Migration def self.up down f = Fixtures.new(Orders.connection, # a database connection "orders", # table name Order, # model class File.join(File.dirname(__FILE__), "dev_data/orders")) f.insert_fixtures end
def self.down Order.delete_all end end
My orders.yml is as follows:
bugs_order: date: 10/2/2006 12:00:00 AM customer: Bugs Bunny total: 74.00 charge_status: offline daffy_order: date: 10/1/2006 12:00:00 AM customer: Daffy Duck total: 65.99 charge_status: approved
My 001_create_orders.rb looks like:
class CreateOrders < ActiveRecord::Migration def self.up create_table :orders do |t| t.column :date, :timestamp t.column :customer, :string t.column :total, :decimal t.column :charge_status, :string end end
def self.down drop_table :orders end end
After I run rake migrate I don't see any data populated into the orders table. Am I missing something here? TIA.