   addReferences: (metaModel) ->
     for reference in @graph.getReferences()
 
-      metaModel[@graph.getName reference] =
+      metaModel.push
         mType: Constants.REFERENCE
         name: @graph.getName reference
         sourceDeletionDeletesTarget: @graph.getSourceDeletionDeletesTarget reference

  addEnums: (metaModel) ->
    for thisMEnum in mEnum.getMEnums()

      metaModel[thisMEnum.name] =
        mType: Constants.ENUM
        name: thisMEnum.name
        type: thisMEnum.type


  # Builds the metaModel JSON object and returns it.
  createMetaModel: () ->
    metaModel = []

    @addClasses metaModel
    @addReferences metaModel
