Releases: ampatspell/ember-cli-sofa
Releases · ampatspell/ember-cli-sofa
FastBoot session support
- [new] Session support in FastBoot
- [new] Default to FastBoot request protocol and host if CouchDB URL is relative
belongsTo "collection" relationship
belongsTo in the way hasMany was implemented in 2.0.5
Transient models
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
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('models.@each.isDirty', function() {
return this.get('models').filterBy('isDirty', true);
}).readOnly()
});
Relationship can also include query
Ember.js 2.13.3
v2.0.4 2.0.4
Relationship classes and Query factories
v2.0.3 2.0.3
Fastboot
models and collections work, session state is still missing.
v2.0.1
ember-cli-couch
now uses ember-fetch
_changes and _db_updates
// 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
Allow overriding per-database attachments, attachment, attachment-content classes.
And recreate them if model database is set separately from model creation.