mergeAttributes in models