From fc5c02f57db9d7b85c5d6a813e8f2ee0a30d2e1f Mon Sep 17 00:00:00 2001 From: Matt Marcum Date: Sat, 19 Mar 2016 17:33:39 -0500 Subject: [PATCH] updated readme --- README.md | 12 ++++++++++++ .../files/__root__/serializers/__name__.js | 3 +++ blueprints/pouch-serializer/index.js | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 blueprints/pouch-serializer/files/__root__/serializers/__name__.js create mode 100644 blueprints/pouch-serializer/index.js diff --git a/README.md b/README.md index 97af1a4..faedf00 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ This provides - `import PouchDB from 'pouchdb'` - `import {Model, Adapter, Serializer} from 'ember-pouch'` +You must install an adapter and serializer in order for `Ember-Pouch` to work correctly. The [`blueprints`](#emberpouch-blueprints) are the easiest way to get started. + `Ember-Pouch` requires you to add a `rev: DS.attr('string')` field to all your models. This is for PouchDB/CouchDB to handle revisions: ```js @@ -114,6 +116,16 @@ ENV.emberPouch.localDb = 'test'; ENV.emberPouch.remoteDB = 'http://localhost:5984/my_couch'; ``` +### Serializer + +In order to create an application serializer run the following command from the command line: + +``` +ember g pouch-serializer application +``` + +An application serializer is required to get relations working correctly! + ## Sample app Tom Dale's blog example using Ember CLI and EmberPouch: [broerse/ember-cli-blog](https://github.com/broerse/ember-cli-blog) diff --git a/blueprints/pouch-serializer/files/__root__/serializers/__name__.js b/blueprints/pouch-serializer/files/__root__/serializers/__name__.js new file mode 100644 index 0000000..efbfd02 --- /dev/null +++ b/blueprints/pouch-serializer/files/__root__/serializers/__name__.js @@ -0,0 +1,3 @@ +import { Serializer } from 'ember-pouch'; + +export default Serializer.extend(); diff --git a/blueprints/pouch-serializer/index.js b/blueprints/pouch-serializer/index.js new file mode 100644 index 0000000..9b9fbf1 --- /dev/null +++ b/blueprints/pouch-serializer/index.js @@ -0,0 +1,3 @@ +var EmberCliSerializerBlueprint = require('ember-cli/blueprints/serializer'); + +module.exports = EmberCliSerializerBlueprint;