def save
      if self.class.belongs_to_associations
        used_attributes = self.class.prefix_associations(prefix_options).map {|association| association.attribute}
        used_attributes.each do |attribute|
          attributes.delete("#{attribute}_id".intern)
        end
      end
      super
    end
def save
      if self.class.belongs_to_associations
        used_attributes = self.class.prefix_associations(prefix_options).map {|association| association.attribute}
        used_attributes.each do |attribute|
          attributes.delete("#{attribute}_id".intern)
        end
      end
      super
    end
In order to support two-way belongs_to associations in a
 reasonable way, we duplicate all of the prefix options as real
 attributes (so license.lawyer_id will set both the lawyer_id
 attribute and the lawyer_id prefix option). When we're ready to
 save, we should take all the parameters that we're already
 sending as prefix options and remove them from the model's
 attributes so we don't send duplicates down the wire. This way,
 if you have an object that belongs_to :lawyer and belongs_to
 :phone (in that order), setting lawyer_id and phone_id will
 treat lawyer_id as a prefix option and phone_id as a normal
 attribute.