Removing unwanted model.set for related attr

when a related field value already set is exactly same as the value passed (not
just properties, but the same object itself), avoid copying attrs
Removing hardcoding of idAttribute