classUserextendsModel {staticentity='users'staticfields () {return {userId: this.attr(null),published: this.attr(false) } }staticcreating (model, record) {// change values before savingmodel.published=trueif (model.userId===2) {// prevent model with userId 2 being saved in the storereturnfalse }// check original dataconsole.log(record) }}