Forum: Ruby on Rails conflict between before_create with db:migrate

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.
Ffd881829651935d986c52d12279befb?d=identicon&s=25 Zhenning Guan (rubyernewbie)
on 2009-01-15 13:12
I have a User and Folder model
class User
has_many :folders
before_create :make_box

def make_box
 folders.build(:name => "red")
end

when I run db:migrate, the got a error!
==
Mysql::Error: Table 'kaixin2009_development.folders' doesn't exist: SHOW
FIELDS FROM `folders`
==
so what's wrong with my operation?
9cf6e7f81d4339295b86e5fb7d7df49b?d=identicon&s=25 Vishwanath Nayak (nayak)
on 2009-01-15 13:15
(Received via mailing list)
Hi,

Do you have a migration for creating folders table?

NAYAK

On Thu, Jan 15, 2009 at 5:42 PM, Zhenning Guan <
rails-mailing-list@andreas-s.net> wrote:

> when I run db:migrate, the got a error!
> ==
> Mysql::Error: Table 'kaixin2009_development.folders' doesn't exist: SHOW
> FIELDS FROM `folders`
> ==
> so what's wrong with my operation?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
- NAYAK
This topic is locked and can not be replied to.