key_from of has_one must be primary key ?
Here is my relation:
Model_A: id, B_id, ....
has_one:
key_from => B_id
model_to => Model_B
key_to => id
Model_B: id, ......
when I forge a model:
$a = Model_A::forge()
$a->b = Model_B::forge()
$a->save()
it shows error:
the "B_id" field of A can't be null
but ..... shouldn't "B_id" of A be assigned to the same value of "id" of B automatically?
i.e. ORM should do this: $a->B_id = $a->b->id;
can anyone help me?
Thanks!