def set_attribute_inverse(attribute, inverse)
      prop = property(attribute)
      # the standard attribute
      pa = prop.attribute
      # return if inverse is already set
      return if prop.inverse == inverse
      # the default inverse
      inverse ||= prop.type.detect_inverse_attribute(self)
      # If the attribute is not declared by this class, then make a new attribute
      # metadata specialized for this class.
      unless prop.declarer == self then
        prop = restrict_attribute_inverse(prop, inverse)
      end
      logger.debug { "Setting #{qp}.#{pa} inverse to #{inverse}..." }
      # the inverse attribute meta-data
      inv_prop = prop.type.property(inverse)
      # If the attribute is the many side of a 1:M relation, then delegate to the one side.
      if prop.collection? and not inv_prop.collection? then
        return prop.type.set_attribute_inverse(inverse, pa)
      end
      # This class must be the same as or a subclass of the inverse attribute type.
      unless self <= inv_prop.type then
        raise TypeError.new("Cannot set #{qp}.#{pa} inverse to #{prop.type.qp}.#{pa} with incompatible type #{inv_prop.type.qp}")
      end
      # Set the inverse in the attribute metadata.
      prop.inverse = inverse
      # If attribute is the one side of a 1:M or non-reflexive 1:1 relation, then add the inverse updater.
      unless prop.collection? then
        # Inject adding to the inverse collection into the attribute writer method. 
        add_inverse_updater(pa)
        unless prop.type == inv_prop.type or inv_prop.collection? then
          prop.type.delegate_writer_to_inverse(inverse, pa)
        end
      end
      logger.debug { "Set #{qp}.#{pa} inverse to #{inverse}." }
    end
def set_attribute_inverse(attribute, inverse)
      prop = property(attribute)
      # the standard attribute
      pa = prop.attribute
      # return if inverse is already set
      return if prop.inverse == inverse
      # the default inverse
      inverse ||= prop.type.detect_inverse_attribute(self)
      # If the attribute is not declared by this class, then make a new attribute
      # metadata specialized for this class.
      unless prop.declarer == self then
        prop = restrict_attribute_inverse(prop, inverse)
      end
      logger.debug { "Setting #{qp}.#{pa} inverse to #{inverse}..." }
      # the inverse attribute meta-data
      inv_prop = prop.type.property(inverse)
      # If the attribute is the many side of a 1:M relation, then delegate to the one side.
      if prop.collection? and not inv_prop.collection? then
        return prop.type.set_attribute_inverse(inverse, pa)
      end
      # This class must be the same as or a subclass of the inverse attribute type.
      unless self <= inv_prop.type then
        raise TypeError.new("Cannot set #{qp}.#{pa} inverse to #{prop.type.qp}.#{pa} with incompatible type #{inv_prop.type.qp}")
      end
      # Set the inverse in the attribute metadata.
      prop.inverse = inverse
      # If attribute is the one side of a 1:M or non-reflexive 1:1 relation, then add the inverse updater.
      unless prop.collection? then
        # Inject adding to the inverse collection into the attribute writer method. 
        add_inverse_updater(pa)
        unless prop.type == inv_prop.type or inv_prop.collection? then
          prop.type.delegate_writer_to_inverse(inverse, pa)
        end
      end
      logger.debug { "Set #{qp}.#{pa} inverse to #{inverse}." }
    end
Sets the given bi-directional association attribute's inverse.

 @param [Symbol] attribute the subject attribute
 @param [Symbol] the attribute inverse
 @raise [TypeError] if the inverse type is incompatible with this Resource