lib/Models/RegionMapping.js
function loadRegionIds(regionMapping, rawRegionDetails) {
  var promises = rawRegionDetails.map(function(rawRegionDetail) {
    return rawRegionDetail.regionProvider.loadRegionIDs();
  });
  return when
    .all(promises)
    .then(function() {
      // Cache the details in a nicer format, storing the actual columns rather than just the column names.
      regionMapping._regionDetails = rawRegionDetails.map(function(
        rawRegionDetail
      ) {
        return {
          regionProvider: rawRegionDetail.regionProvider,
          columnName: rawRegionDetail.variableName,
          disambigColumnName: rawRegionDetail.disambigVariableName
        };
      });
      return regionMapping._regionDetails;
    })
    .otherwise(function(e) {
      console.log("error loading region ids", e);
    });
}
function loadRegionIds(regionMapping, rawRegionDetails) {
  var promises = rawRegionDetails.map(function(rawRegionDetail) {
    return rawRegionDetail.regionProvider.loadRegionIDs();
  });
  return when
    .all(promises)
    .then(function() {
      // Cache the details in a nicer format, storing the actual columns rather than just the column names.
      regionMapping._regionDetails = rawRegionDetails.map(function(
        rawRegionDetail
      ) {
        return {
          regionProvider: rawRegionDetail.regionProvider,
          columnName: rawRegionDetail.variableName,
          disambigColumnName: rawRegionDetail.disambigVariableName
        };
      });
      return regionMapping._regionDetails;
    })
    .otherwise(function(e) {
      console.log("error loading region ids", e);
    });
}
function loadRegionIds ( regionMapping , rawRegionDetails ) { var promises = rawRegionDetails . map ( function ( rawRegionDetail ) { return rawRegionDetail . regionProvider . loadRegionIDs ( ) ; } ) ; return when . all ( promises ) . then ( function ( ) { // Cache the details in a nicer format, storing the actual columns rather than just the column names. regionMapping . _regionDetails = rawRegionDetails . map ( function ( rawRegionDetail ) { return { regionProvider : rawRegionDetail . regionProvider , columnName : rawRegionDetail . variableName , disambigColumnName : rawRegionDetail . disambigVariableName } ; } ) ; return regionMapping . _regionDetails ; } ) . otherwise ( function ( e ) { console . log ( "error loading region ids" , e ) ; } ) ; }
Loads region ids from the region providers, and returns the region details.
Loads region ids from the region providers and returns the region details .