def add_association(name, type, metadata={})
      associations << (metadata || {}).merge(:name => name.to_sym, :type => type.to_sym)
    end
def add_association(name, type, metadata={})
      associations << (metadata || {}).merge(:name => name.to_sym, :type => type.to_sym)
    end
Defines an association

 @param [String] name The name of the association
 @param [Symbol] type The type of the association
 @param [Hash{Symbol => Object}] metadata The metadata for the association