Forum: Ruby on Rails Migrations and Unintialized Constants Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-11 02:47
(Received via mailing list)
I am running into a problem with two of my tables and the
"uninitialized constant" error when using migration.

I get the "uninitialized constant Note" when running the following
code in my migration file:

     create_table :notes do |t|
       t.column :id, :integer
       t.column :noteshare_id, :integer
       t.column :title, :string
       t.column :covered, :string
       t.column :content, :text
       t.column :created_at, :datetime
       t.column :updated_at, :datetime
     end
     Note.create_versioned_table

The same thing happens with:

     create_table :faculties do |t|
       t.column :id, :integer
       t.column :school_id, :integer
       t.column :name, :string
       t.column :created_at, :datetime
       t.column :updated_at, :datetime
     end
     Faculty.create :school_id => 1, :name => "Faculty of Engineering
and Computer Science"

Anyone can give me some insight into my problem please :-)

Would be greatly appreciated :-).

Your Friend,

John Kopanas
http://www.kopanas.com


=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-02-11 03:11
(Received via mailing list)
Do you have a Note model?

Does it compile without error?

P.S. If you're using acts_as_versioned, then you need a version column
      in that table as well.

--
-- Tom Mornini
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-11 07:53
(Received via mailing list)
For notes I fixed everything thanks.  Stupid me I called the model
Notes instead of just note.

On 10-Feb-06, at 9:11 PM, Tom Mornini wrote:

>
>>       t.column :covered, :string
>>       t.column :school_id, :integer
>>
>>
>>
>> _______________________________________________
>> Rails mailing list
>> Rails@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails


John Kopanas
http://www.kopanas.com


=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference
This topic is locked and can not be replied to.