[eluser]DocO[/eluser]
Not sure if this is addressed somewhere, but couldn't find it. It may be an architectural problem of my own, or a misunderstanding.
I'm using 1.8.2, and I have a one-to-one relationship between ObjectA and ObjectB. The relationship is defined via $has_one in both models, and in the table ObjectA has an "objectb_id" field.
I'm not sure where enforcement of the one-to-one relationship should be applied and how. Right now, I can save two different instances of ObjectA, with the same relationship to one instance of ObjectB, and that shouldn't happen.
Right now I'm using CodeIgniter's form validation, mainly because that is what I used before It used DataMapper, and I have a few custom functions. Do I need to move to DataMapper's object validation instead? And if so, do I need to write a custom validation? Or is "unique_pair" what I want (as in, using "unique_pair" => "objectb_id" or something like that)?