def detect_inverse_attribute(klass)
      # The candidate attributes return the referencing type and don't already have an inverse.
      candidates = domain_attributes.compose { |prop| klass <= prop.type and prop.inverse.nil? }
      pa = detect_inverse_attribute_from_candidates(klass, candidates)
      if pa then
        logger.debug { "#{qp} #{klass.qp} inverse attribute is #{pa}." }
      else
        logger.debug { "#{qp} #{klass.qp} inverse attribute was not detected." }
      end
      pa
    end
def detect_inverse_attribute(klass)
      # The candidate attributes return the referencing type and don't already have an inverse.
      candidates = domain_attributes.compose { |prop| klass <= prop.type and prop.inverse.nil? }
      pa = detect_inverse_attribute_from_candidates(klass, candidates)
      if pa then
        logger.debug { "#{qp} #{klass.qp} inverse attribute is #{pa}." }
      else
        logger.debug { "#{qp} #{klass.qp} inverse attribute was not detected." }
      end
      pa
    end
Detects an unambiguous attribute which refers to the given referencing class.
 If there is exactly one attribute with the given return type, then that attribute is chosen.
 Otherwise, the attribute whose name matches the underscored referencing class name is chosen,
 if any.

 @param [Class] klass the referencing class
 @return [Symbol, nil] the inverse attribute for the given referencing class and inverse,
   or nil if no owner attribute was detected