         if subModelName = typeInfo?.model
 
             # creates submodels
-            if typeInfo.name is 'MODELS' and Array.isArray value
+            if typeInfo.equals('MODELS') and Array.isArray value
                 @setSubModelArrToModel(model, prop, value, subModelName)
                 return
 
             # creates submodel
-            if typeInfo.name is 'MODEL'
+            if typeInfo.equals 'MODEL'
                 @setSubModelToModel(model, prop, value, subModelName)
                 return
 


            model.setRelatedModels(prop, subModels)

        else # if typeInfo.name is 'MODEL'

            id = model[idPropName]
            subModel = repository.getByIdSync(id)

        catch e
            return

        if typeInfo.equals 'MODELS'

            ids = model[idPropName]
            return if not Array.isArray ids
