FiguredLimited / vue-mc

Models and Collections for Vue
https://vuemc.io
MIT License
626 stars 98 forks source link

routes is not a function if model has "routes" attribute #118

Open throrin19 opened 5 years ago

throrin19 commented 5 years ago

I think the library has a problem, depends on the model attributes we have. For example, I Have this model :

{
  id : 1,
  name : 'test',
  routes : []
}

With this attribute routes, I have the specific error if I try to launch a fetch, save or delete :

TypeError: this.routes is not a function
    at DatabaseMachineModel.getRoute (vue-mc.es.js:731)
    at DatabaseMachineModel.getDeleteRoute (vue-mc.es.js:591)
    at DatabaseMachineModel.getDeleteURL (vue-mc.es.js:764)

I think, the problem is with all specifics fields with model functions names. Try with, for example, a model with the attribute request and you crash all the model.