I have two models: Bar HABTM Foo. Now I have bars_foos join table with some additional fields.
When I add new Bar with some Foo associations or vice versa, I need to run many validation checks, whether the new associations are kosher. Checks are based on the additional fields defined and already saved associations.
Where should I run these validations? In Bar/Foo controller? Or should I create BarsFoo model with validation rules?
When I keep HABTM relationship to get all the auto-magic from Cake, I cannot find a way to tell Cake to use my own predefined BarsFoo model with validations rules. Cake creates its own virtual model and ignores mine.
Or should I (in this specific case) break HABTM into hasMany-belongsTo-hasMany relationship, where I can use my own BarsFoo model?