
Datamapper doesnt handle namespaced models well
Reported by Yaroslaff Fedin | April 13th, 2008 @ 10:24 AM
It tries to search for table "namespace/model" which is incorrect SQL table name.
Comments and changes to this ticket
-
Dan Kubb (dkubb) April 14th, 2008 @ 05:19 PM
- State changed from new to invalid
This is a duplicate of #203
-
Yaroslaff Fedin April 15th, 2008 @ 09:53 AM
It's not duplicate.
The fix for this, is in http://wm.lighthouseapp.com/proj...
-
Yaroslaff Fedin April 15th, 2008 @ 10:00 AM
And again, i'm going to ask you to re-open the ticket.
The fix buy guyvdb replaces "/" character with underscore. It's good for sql, but not for yaml and other files. For files it's perfectly okay to put namespaced repositories into directories. So this needs some kind of more complex solution.
-
Dan Kubb (dkubb) April 15th, 2008 @ 10:36 AM
- State changed from invalid to open
-
Dan Kubb (dkubb) April 15th, 2008 @ 10:40 AM
- Milestone cleared.
-
Guy van den Berg (guyvdb) April 15th, 2008 @ 11:16 PM
- Assigned user set to Guy van den Berg (guyvdb)
Fedin,
I was thinking about your example - yaml adapter vs sql adapter. I think that my solution is still fine. NamingConvention takes care of the case. My fix is for the default NamingConvention UnderscoredAndPluralized.
For the case of the yaml adapter one would create a PathSeperateModuleUnderscoreAndPluralized naming convention and apply that naming convention to the yaml adapter.
repository(:sql).adapter.resource_naming_convention = DM::NC::UnderscoredAndPluralized
repository(:yaml).adapter.resource_naming_convention = MyLib::NC::PathSeperateModuleUnderscoreAndPluralized
-
Guy van den Berg (guyvdb) April 18th, 2008 @ 01:09 AM
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Referenced by
-
203 Namespaced models break associations Please, reopen this ticket. It's not duplicate with #202...