Add setting of FK for throgh associations while building

We should set FK for records, were built via through_associtation when it is possible (through has_one associations).

Fixes #12698