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.2 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.4.24 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.23 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.5.1 components/indefinido/indemma/master/lib/record/persistable.js
ende-0.4.22 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.21 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.5.0 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.20 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.19 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.18 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.17 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.16 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.15 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.14 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.13 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.12 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.11 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.10 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.9 vendor/components/indefinido-indemma/lib/record/persistable.js
ende-0.4.8 vendor/components/indefinido-indemma/lib/record/persistable.js