[eluser]yoast[/eluser]
I've got a new issue, which could be a bug (or feature).
There are three models, they have the following relations:
A has one B (can be null)
A has many C
B has many A
B has many C
C has one B
C has one A
I fill this table by:
1. importing A without reference to B,
2. importing B and C
3. Update A with the references to B.
At step 3 datamapper generates strange queries, where it updates all other A's with NULL that have the same B as the one we are about to add to the current A.
[6] => UPDATE `A` SET `B_id` = NULL WHERE `A`.`B_id` = 8 AND `A`.`id` <> 1
[7] => UPDATE `A` SET `B_id` = 8 WHERE `id` = 1
Is this behaviour as it should be? It seems to be enforcing that I only use a B once with an A.