Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/models/task.js

Summary

Maintainability
A
0 mins
Test Coverage
import SharedModelMethods from '../mixins/shared_model_methods';

const Task = Backbone.Model.extend({
  defaults: {
    done: false,
  },

  name: 'task',

  i18nScope: 'activerecord.attributes.task',

  isReadonly: false,

  sync: function (method, model, options) {
    if (model.isReadonly) {
      return true;
    }
    return Backbone.sync(method, model, options);
  },
});

_.defaults(Task.prototype, SharedModelMethods);

export default Task;