Forum: Ruby on Rails Grouping models - table name conflicts

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.
161680423be7c93cd4ce7dc3e080d642?d=identicon&s=25 Gareth Adams (Guest)
on 2006-06-02 12:37
(Received via mailing list)
Hi all, it's my first time posting on the list - this is something I
couldn't
find anywhere else

If I create two models, using
ruby script/generate model foo/bar
ruby script/generate model baz/bar

then the generator has no problem making app/models/foo/bar.rb and
app/models/baz/bar.rb, however the migrate files it creates both try to
"create_table :bars"

I thought this was strange because the migrate files have unique names,
001_create_foo_bars.rb, 002_create_baz_bars.rb

I appreciate that it's often a good idea to keep all models directly in
app/models/ but I couldn't see a reason that everything supports the
option to
group models, except for the migration. What am I missing?

Cheers,
Gareth
161680423be7c93cd4ce7dc3e080d642?d=identicon&s=25 Gareth Adams (Guest)
on 2006-06-02 13:11
(Received via mailing list)
Gareth Adams <gareth@...> writes:

> I thought this was strange because the migrate files have unique names,
> 001_create_foo_bars.rb, 002_create_baz_bars.rb

My bad, I've just seen that there is a problem with the second model -
it
creates a conflicting migration file error.

But I'm still confused about why the model creation is fine but the
migration
creation isn't
This topic is locked and can not be replied to.