lib/index.js
function getHasManyDetails(hasMany) {
    logger.debug('hasMany%s details are calculated for: %s', hasMany.through() ? 'through' : '', hasMany.name());
    var model   = getModelNameFor(hasMany.referencesTable()),
        as      = getHasManyName(hasMany);

    return filterAttributes({
        type                : 'hasMany',
        source              : 'generator',
        name                : hasMany.name(),
        model               : model,
        as                  : getAlias(hasMany.table(), as, 'hasMany'),
        targetSchema        : hasMany.referencesTable().schema().name(),
        targetTable         : hasMany.referencesTable().name(),
        foreignKey          : hasMany.foreignKey(0).name(), // Sequelize support single key only
        onDelete            : hasMany.onDelete(),
        onUpdate            : hasMany.onUpdate(),
        through             : hasMany.through() ? hasMany.through().name() : undefined
    });
}
function getHasManyDetails(hasMany) {
    logger.debug('hasMany%s details are calculated for: %s', hasMany.through() ? 'through' : '', hasMany.name());
    var model   = getModelNameFor(hasMany.referencesTable()),
        as      = getHasManyName(hasMany);

    return filterAttributes({
        type                : 'hasMany',
        source              : 'generator',
        name                : hasMany.name(),
        model               : model,
        as                  : getAlias(hasMany.table(), as, 'hasMany'),
        targetSchema        : hasMany.referencesTable().schema().name(),
        targetTable         : hasMany.referencesTable().name(),
        foreignKey          : hasMany.foreignKey(0).name(), // Sequelize support single key only
        onDelete            : hasMany.onDelete(),
        onUpdate            : hasMany.onUpdate(),
        through             : hasMany.through() ? hasMany.through().name() : undefined
    });
}
function getHasManyDetails ( hasMany ) { logger . debug ( 'hasMany%s details are calculated for: %s' , hasMany . through ( ) ? 'through' : '' , hasMany . name ( ) ) ; var model = getModelNameFor ( hasMany . referencesTable ( ) ) , as = getHasManyName ( hasMany ) ; return filterAttributes ( { type : 'hasMany' , source : 'generator' , name : hasMany . name ( ) , model : model , as : getAlias ( hasMany . table ( ) , as , 'hasMany' ) , targetSchema : hasMany . referencesTable ( ) . schema ( ) . name ( ) , targetTable : hasMany . referencesTable ( ) . name ( ) , foreignKey : hasMany . foreignKey ( 0 ) . name ( ) , // Sequelize support single key only onDelete : hasMany . onDelete ( ) , onUpdate : hasMany . onUpdate ( ) , through : hasMany . through ( ) ? hasMany . through ( ) . name ( ) : undefined } ) ; }
Returns hasMany details as plain object to use in templates.
@private
@param {object} hasMany - pg-structure hasMany object
@returns {Object} - Simple object to use in template
Returns hasMany details as plain object to use in templates .