This project is archived and is in readonly mode.
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:
- It searches up the parent chain and not just the direct parent
- just matching the direct parent may be preferred.
- It only takes the first match - combining all of the table name
prefixes in the parent chain may be preferred
- 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.
- 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
-
José Valim February 23rd, 2010 @ 07:29 AM
- Assigned user changed from José Valim to Jeremy Kemper
- Milestone cleared.
Assigning to Jeremy Kemper, he's the best person to give feedback on this.
-
Andrew White March 15th, 2010 @ 06:17 AM
Updated patch to apply to latest master - just offsets, no code changes.
-
Repository March 29th, 2010 @ 07:46 AM
- State changed from new to resolved
(from [5f7bc47303933ec67700f6390c98d889f6d9b0d1]) Rename modularized_table_name_prefix to full_table_name_prefix [#4032 state:resolved] http://github.com/rails/rails/commit/5f7bc47303933ec67700f6390c98d8...
-
Jeremy Kemper March 29th, 2010 @ 07:47 AM
- State changed from resolved to open
- Milestone set to 2.3.6
-
Andrew White March 29th, 2010 @ 09:49 AM
Backport to 2.3 patch with the method renamed to full_table_name_prefix
-
Repository March 29th, 2010 @ 04:57 PM
- State changed from open to committed
(from [03d5d0b5f50161d8ec1b2b627e483aad7100494a]) Add the ability to specify table_name_prefix on individual modules
[#4032 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/03d5d0b5f50161d8ec1b2b627e483a... -
phs April 11th, 2010 @ 12:41 AM
cross linking #4230. The question is whether the module-specific stuff in this patch can be harnessed in the model generator.
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
Attachments
Referenced by
- 4230 [PATCH] AR migration generator includes model's modules in table name. #4032 might be another way out. If we could find a canoni...
- 4230 [PATCH] AR migration generator includes model's modules in table name. I don't have a justifiable opinion for preferring either ...
- 4230 [PATCH] AR migration generator includes model's modules in table name. Awesome! I talked with Jeremy Kemper and he proposed us t...
- 2965 Advanced / foxy fixture features doesn't work well with models in modules The issue with #2283 is that I backported the patch but i...
- 445 Improved support for model namespaces (fixtures, generators, table naming) Okay - patch and new ticket here
- 4230 AR migration generator includes model's modules in table name. #4032 looks like another issue stomping around in the sam...
- 4032 Module specific table_name_prefix (from [5f7bc47303933ec67700f6390c98d889f6d9b0d1]) Rename ...
- 4032 Module specific table_name_prefix [#4032 state:committed]