Skip to content

Commit

Permalink
Merge pull request #101 from mattmarcum/pouch-model-blueprint
Browse files Browse the repository at this point in the history
Added blueprint for pouch-model
  • Loading branch information
rsutphin committed Dec 19, 2015
2 parents 6d0091b + c94badf commit 0260460
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ PouchDB.debug.enable('*');

See the [PouchDB sync API](http://pouchdb.com/api.html#sync) for full usage instructions.

## EmberPouch Blueprints

### Model

In order to create a model run the following command from the command line:

```
ember g pouch-model <model-name>
```

Replace `<model-name>` with the name of your model and the file will automatically be generated for you.

## Sample app

Tom Dale's blog example using Ember CLI and EmberPouch: [broerse/ember-cli-blog](https://github.com/broerse/ember-cli-blog)
Expand Down
6 changes: 6 additions & 0 deletions blueprints/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"predef": [
"console"
],
"strict": false
}
12 changes: 12 additions & 0 deletions blueprints/pouch-model/files/__root__/__path__/__name__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Model from 'ember-pouch/model';
import DS from 'ember-data';

const {
attr,
hasMany,
belongsTo
} = DS;

export default Model.extend({
<%= attrs %>
});
3 changes: 3 additions & 0 deletions blueprints/pouch-model/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var EmberCliModelBlueprint = require('ember-cli/blueprints/model');

module.exports = EmberCliModelBlueprint;

0 comments on commit 0260460

Please sign in to comment.