Hi,
Right now I am working on the application given from the book
Pragmatic.Bookshelf.Agile.Web.Development.with.Rails.2nd.Edition.Dec.2006
On page 80. I have done the rake db:migrate on the code..
class AddPrice < ActiveRecord::Migration
def self.up
add_column :products, :price, :decimal, :precision => 8, :scale => 2,
:default => 0
end
def self.down
remove_column :products, :price
end
end
When we do rake db:migrate it results in error..
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Sharma>cd
c:\radrails_projects\depotaugust152007
C:\radrails_projects\depotaugust152007>rake db:migrate
(in C:/radrails_projects/depotaugust152007)
== AddPrice: migrating
=======================================================-- add_column(:products,
:price, :decimal, {:default=>0, :precision=>8,
:scale=>
2})
rake aborted!
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]
(See full trace by running task with --trace)
C:\radrails_projects\depotaugust152007>
Please suggest me the ways to solve this..
Thanks in advance sharma
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---