Sha256: 9340df855af44e2a3f68cceb00a17de769d05f5c7f846c0c3e67c3af64dc1954

Contents?: true

Size: 755 Bytes

Versions: 14

Compression:

Stored size: 755 Bytes

Contents

var extend, model, queryable, record, stampit, storable;

extend = require('assimilate');

storable = require('./storable');

stampit = require('../../vendor/stampit');

queryable = {
  storage: storable(),
  find: function(key) {
    if (!key) {
      throw new TypeError("InvalidFind: " + (this.resource.toString()) + ".find was called with a falsey value");
    }
    return this.storage.store(key);
  },
  every: function(callback) {
    return callback(this.storage.values());
  },
  where: function() {
    throw new Error('queryable.where: Not implemented yet');
  }
};

model = window.model;

record = window.record;

model.queryable = true;

module.exports = queryable;

model.mix(function(modelable) {
  return extend(modelable, queryable);
});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ende-0.5.22 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.21 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.20 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.19 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.18 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.17 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.16 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.15 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.14 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.13 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.12 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.10 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.9 components/indefinido/indemma/master/lib/record/queryable.js
ende-0.5.8 components/indefinido/indemma/master/lib/record/queryable.js