So i have my User model and an Office model.
A User can only belong to one Office.
So first question is, I have initially set this up, so that the Office table/model has the FK to user_id in User table/model.
Is that ok, or should the User table have the FK to office_id ?
Second, I would like to only allow the User that has an Office child, to create records in a third "Fees" table. So in Fees/create, the field for "Office" should come up automatically, based on the FK User->Office.
So first one is a design question to be sure if that’s valid setup, 2nd, I can’t find implementation of that relationship although I’m sure its there somewhere Otherwise, will that implementation be easier/better, if the relationship were the other way around?
Thx