Skip to content

Commit

Permalink
Use include and filter params from endpoints adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
leobalter committed May 15, 2015
1 parent a47ee36 commit 3a629af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
11 changes: 11 additions & 0 deletions app/adapters/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import adapter from 'ember-data-endpoints/adapter';

export default adapter.extend({
host: '',
queryParams: {
include: 'chapters',
filter: {
published_after: '1990-01-01'
}
}
});
8 changes: 1 addition & 7 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import Ember from 'ember';

export default Ember.Route.extend({
model: function() {
return this.store.find('book', {
include: "chapters",
//'filter[published_after]': '1990-01-01'
filter: {
published_after: '1990-01-01'
}
});
return this.store.find('book');
}
});
12 changes: 12 additions & 0 deletions tests/unit/adapters/index-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('adapter:index', 'Unit | Adapter | index', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
var adapter = this.subject();
assert.ok(adapter);
});

0 comments on commit 3a629af

Please sign in to comment.