jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

BelongsTo automatic column name to be based on field name #162

Closed humaninternals closed 14 years ago

humaninternals commented 14 years ago

When a 'worker'=>new Field_BelongsTo(array('foreign'=>'person')) field is defined, I believe its more common for the local column name to be 'worker_id', and not 'person_id'. Therefore I suggest guessing the local column name based on the field name, and not on the remote model name.

I do realize it could break some code, but I find myself having to set column name manually many times for cases like those, and it just seems more logical for Jelly to guess the column name based on the field name the way I suggested.

jonathangeiger commented 14 years ago

Closed by 9c53b46ed7434c4edf6167982c125989218a33b4. Thanks humaninternals!