I suggest you ...

Implement true many-to-one support for database relationships

Many-to-one relationships are not correctly implemented, and the description on http://www.castleproject.org/activerecord/gettingstarted/relations.html is wrong.
"Belongs to" and "Has many" both express a one-to-many relationship, and in fact are complimentary attributes.

A "many to one" relationship consists of foreign keys in table A which reference ONE record in table B, but a record in table B may be referenced by MANY records in table A, hence "many to one". Just to clarify, table A is on the left, and many A records can reference one B record.

As an example, consider some database that holds people records, automobile records, and the trips they take. A given automobile can be driven by any legal driver, but for a specific trip only one person drives. Therefore, a trip record has one vehicle, and one driver. However, a vehicle might make more than one trip, and a given driver might also make more than one trip. So each trip record has two many-to-one relationships:
The trips table --> vehicles table, and the trips table --> people table.

This data arrangement cannot be expressed using "belongs to" terminology because a given vehicle does not "belong to" a trip - having a trip ID column on the vehicles table would not be semantically correct. Any case where "belongs to" applies is a "one-to-many" relationship, since the right-hand table references directly a single record on the left-hand side.

3 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Aaron shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base