Is this needed, since it'll come through the model.attributes loop above?  If the primary_key is affecting it, perhaps just move that line instead.