Sha256: cfdbfa02f99ab8b69784d083d7557b4d094c9744dfa3f382c213e5387a6a30b1

Contents?: true

Size: 774 Bytes

Versions: 48

Compression:

Stored size: 774 Bytes

Contents

var handlers, model, persistable, record;

require('./queryable');

handlers = {
  store_after_saved: function() {
    var storage;

    storage = model[this.resource.toString()].storage;
    if (this._id) {
      return storage.store(this._id, this);
    }
  }
};

persistable = {
  record: {
    after_initialize: function() {
      var storage;

      if (this._id) {
        storage = model[this.resource.toString()].storage;
        return storage.store(this._id, this);
      } else {
        return this.after('saved', handlers.store_after_saved);
      }
    }
  }
};

model = window.model;

record = window.record;

model.persistable = true;

model.mix(function(modelable) {
  return modelable.record.after_initialize.push(persistable.record.after_initialize);
});

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
ende-0.5.22 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.21 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.20 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.19 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.18 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.17 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.16 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.15 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.14 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.13 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.12 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.10 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.9 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.8 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.7 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.6 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.4.25 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.5.5 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.4 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.5.3 components/indefinido/indemma/master/lib/record/persistable.js