This is surprising. I assumed this would be dirty-tracking foreign keys that would be nullified by the `#replace` call.

Dirty tracking is limited to a record's own attributes, not the rest of the object graph it participates in. That breaks down quickly since "changedness" isn't the concern of one single object in the graph. From every object's perspective, everything else has changed.

So, this won't fly.

(Consider performance, too - `foo.bar_ids = []` when `foo.bars.count == 10**9` ... just loaded the whole set into mem.)