VeryModel icon indicating copy to clipboard operation
VeryModel copied to clipboard

submodals with static throw error on create

Open terinjokes opened this issue 9 years ago • 0 comments

var MyModel = new verymodel.Model({
  id: {type: 'string', static: true},
  owner: {model: {
    owner_id: {type: 'string', static: true}
  }}
});

var model = MyModel.create({
  id: 'foobar',
  owner: {
    owner_id: 'fizzbuzz'
  }
});

// Error: Cannot set static values
//    at Object.owner_id (…/node_modules/verymodel/lib/model.js:347:27)

Identified in https://github.com/cloudflare/node-cloudflare/issues/2

terinjokes avatar May 23 '16 17:05 terinjokes