This project is archived and is in readonly mode.

#4032 ✓committed
Andrew White

Module specific table_name_prefix

Reported by Andrew White | February 22nd, 2010 @ 11:37 AM | in 2.3.6

The attached patch adds the ability to specify a table_name_prefix on the parent module of namespaced models. This is useful when building engines/plugins for reuse in different applications to help prevent table name conflicts.

There are a few possible areas of contention:

  1. It searches up the parent chain and not just the direct parent - just matching the direct parent may be preferred.
  2. It only takes the first match - combining all of the table name prefixes in the parent chain may be preferred
  3. It ignores the global table name prefix when it finds a module table name prefix - prefixing the module table name prefix with the global table name prefix may be preferred.
  4. The module table name prefix has no effect when the table name is explicitly set. This is the current behaviour of the global table name prefix but there is no test that I can see that explicitly tests this behaviour.

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>

Referenced by

Pages