This project is archived and is in readonly mode.
Generated migration for namespaced model prefixes table name
Reported by Andrew White | March 17th, 2009 @ 10:55 AM | in 2.x
When generating a namespaced model the migration prefixes the table name with the namespace even though current Rails behaviour is to only prefix a table name when nested inside another AR model. e.g:
script/generate model Admin::User
generates:
class CreateAdminUsers < ActiveRecord::Migration
def self.up
create_table :admin_users do |t|
t.timestamps
end
end
def self.down
drop_table :admin_users
end
end
I've not got a patch at the moment because I can't decide where the problem should be fixed or what the correct behavior should be. I was investigating #2262 so I'm just logging the problem for now to build up a list of issues with namespaced models with the aim of building a bunch of failing tests.
Comments and changes to this ticket
-
Daniel Guettler March 17th, 2009 @ 01:25 PM
Actually this is what I would expect to happen. At least I'm using it this way successfully now since quite some time.
-
kmpm July 27th, 2009 @ 11:15 AM
#1976 is in the same general area as this one as well so people definitely do have issues with this.
-
Andrew White April 11th, 2010 @ 09:35 AM
- Assigned user set to José Valim
This can be closed as we're addressing the issue in #4320
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 2674 Namespaced model table name inconsistency Appears to be a duplicate of #2267 - maybe you can work t...