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.