This project is archived and is in readonly mode.

#2267 ✓duplicate
Andrew White

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

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

Pages