 |
Forums |
Admin Start New Thread
By: Bryan Evans
RE: Association Names in the Non-Vanilla Case [ reply ] 2007-03-08 15:20
|
Hmmm...underwhelming response so far
I want to add support for generation of multiple associations from table A to table B. I'm thinking that I will just name the association using the column name (if there are multiple associations), as you suggested, and evolve this as cases come up where it doesn't work well (eg. if the column is called vice_president_id, DrySQL could name the association "vice_president").
|
By: Mike Harris
Association Names in the Non-Vanilla Case [ reply ] 2007-02-15 15:39
|
Here are a couple examples:
1) The table "division" has the column "president," which references the table "person."
2) The table "division" has the columns "president" and "vice_president," which both reference the table "person."
Currently, Division gets one :person relation in both cases. In #1 it's not necessarily named in the most helpful way, and in #2 the 2nd relation doesn't exist (is overwritten).
One way to do this would be to build the name of the relation off the column name, given Division :president and :vice_president relations. This works well in this case, but I don't know that it would work well in the majority of cases.
Thoughts?
|
|
 |