I’m new to rails programming so, I’m probably missing something simple.
I’ve got a simple application talking with MySQL. My application actually starts just fine using the database name, username, and password for the database. I can also use the console to create new objects (in my case Program.create(…)) with no problem. When I do migrations table creation calls also work. I didn’t install InstantRails like the book. I was following along with how to load data in the sample app.
The problem I’m encountering is when I do a migrate (rake db:migrate) with create and/or delete_all calls. I get an undefined method error. I assumed the basic rake was working since it was creating my tables.
Here is a sample of a migration file that fails (undefined method on the Program.delete_all):
` class ProgramsLoad < ActiveRecord::Migration def self.up
Program.delete_all #Program.create(:name => 'Program 1', # :description => 'Program 1 description')
def self.down #Program.delete_all end end `
Like I said, these commands work when in the console (script/console).
Thoughts? Any help would be appreciated.