Skip Menu |

This queue is for tickets about the CatalystX-ListFramework-Builder CPAN distribution.

Report information
The Basics
Id: 42409
Status: resolved
Priority: 0/
Queue: CatalystX-ListFramework-Builder

People
Owner: OLIVER [...] cpan.org
Requestors: LEEDO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.39
Fixed in: (no value)



Subject: many-to-many relationships use the wrong name for the column header
I have a many-to-many relationship called "immune_tribes" which connects Challenges and Tribes. LFB seems to handle the relationship just fine, but it is using "Tribe (FK)" as the column header instead of "Immune Tribes." Is there any way to have it display the many-to-many relationship name instead of the name of the referenced table? I can attach a basic schema that shows this issue if that would help.
Hi Lee, On Wed Jan 14 11:41:16 2009, LEEDO wrote: Show quoted text
> Is there any way to have it display the many-to-many > relationship name instead of the name of the referenced table?
There is no way in the current version to override the name used, but I am part way through a refactoring of the code and one of the new features is to override your columns headings via config. I'll leave this ticket open as a reminder for me to let you know when the new version is on CPAN for testing. regards, oliver.
Is there any way to simply use the many-to-many relationship's accessor? I think it is a great idea to allow custom column headers, but I think the default could definitely improved by using the accessor for the column header instead. I would be happy to try to implement it if you think it is possible and a good idea. Thanks for all your great work!
Hi Lee, On Wed Jan 14 17:02:40 2009, LEEDO wrote: Show quoted text
> Is there any way to simply use the many-to-many relationship's > accessor? I think it is a great > idea to allow custom column headers, but I think the default could > definitely improved by using > the accessor for the column header instead.
There's always a good convention versus configuration argument to be had :-) The behaviour of LFB is designed to be sensible in the case where the link table is simply that - a link between two more interesting tables. In your case: 'I have a many-to-many relationship called "immune_tribes" which connects Challenges and Tribes.' So when you're in the Challenges table, the related records are "Tribes", and when you're in the Tribes table, the related records are "Challenges". I would expect the link table and accessor to be called challenge_tribe or similar. I figured there would be a higher chance that the name of the related table the other side of the m2m relation would be required - I've seen accessors and link tables with some really odd names, because people believe they are just "hidden away" or only used for method calls. So I'm reluctant to change the default, but I'm thinking of other ways around it (this is a good opportunity, as I'm refactoring). It could be a flag or similar so LFB uses one mode of name resolution, versus another. Feel free to put a patch together if you want, or have a think and suggest other ideas (especially if they involve automagical sensing). Many thanks as well for the feedback! regards, oliver.