Skip to content

Releases: ampatspell/ember-cli-sofa

FastBoot session support

03 Aug 22:21
Compare
Choose a tag to compare
  • [new] Session support in FastBoot
  • [new] Default to FastBoot request protocol and host if CouchDB URL is relative

belongsTo "collection" relationship

01 Jul 23:43
Compare
Choose a tag to compare

belongsTo in the way hasMany was implemented in 2.0.5

Transient models

28 Jun 16:23
Compare
Choose a tag to compare

Transient models:

  • requires id on creation
  • cannot be saved, reloaded or deleted
  • are included in fastboot shoebox so all has-many-collection relationships are included also with loaded state
let state = db.get('state', 'singleton');

See example in portfolio app:

hasMany collection

27 Jun 20:39
Compare
Choose a tag to compare

hasMany relationship without inverse where content is matched against all known models

// models/root.js
import { Model, hasMany } from 'sofa';

export default Model.extend({

  dirty: hasMany(null, { inverse: null, relationship: 'dirty' }),

});
// relationships/dirty.js
import { Relationship } from 'sofa';

export default Relationship.extend({

  matches: computed('[email protected]', function() {
    return this.get('models').filterBy('isDirty', true);
  }).readOnly()

});

Relationship can also include query

Ember.js 2.13.3

25 Jun 22:18
Compare
Choose a tag to compare
v2.0.4

2.0.4

Relationship classes and Query factories

25 Jun 21:40
Compare
Choose a tag to compare

Fastboot

18 Jun 19:21
Compare
Choose a tag to compare

models and collections work, session state is still missing.

v2.0.1

18 Jun 18:19
Compare
Choose a tag to compare

ember-cli-couch now uses ember-fetch

_changes and _db_updates

18 Jun 00:19
Compare
Choose a tag to compare
// sofa/changes/all.js
import { DatabaseChanges } from 'sofa';

export default DatabaseChanges.extend({
  feed: [ 'event-source', 'long-polling' ]
});
let changes = db.changes('all');
changs.on('change', change => console.log(change));
changes.start();

see portfolio app for an example: https://github.com/ampatspell/portfolio/blob/changes-listener/app/instance-initializers/portfolio-changes.js

Per-database attachment classes

09 Jun 15:44
Compare
Choose a tag to compare

Allow overriding per-database attachments, attachment, attachment-content classes.
And recreate them if model database is set separately from model creation.