Skip to content

Commit

Permalink
Merge pull request emberjs#5 from serenaf/feature/deprecation-colections
Browse files Browse the repository at this point in the history
working deprecation collections
  • Loading branch information
serenaf authored Jan 4, 2018
2 parents e2b95fa + 6496606 commit a06898d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export default DS.JSONAPIAdapter.extend({
buildURL(modelName, id, snapshot, requestType, query) {
if (requestType === 'queryRecord') {
return `/${modelName}/${query.path}.json`;
} else if (requestType === 'query') {
return `/${modelName}/${query.path}-${query.version}.json`;
}
return this._super(...arguments);
},
Expand Down
5 changes: 3 additions & 2 deletions app/routes/v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import Route from '@ember/routing/route';

export default Route.extend({
model() {
return this.store.queryRecord('content', {
path: 'initializer-arrity'
return this.store.query('content', {
path: 'ember',
version: 'v2',
})
}
});
4 changes: 3 additions & 1 deletion app/templates/v2.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
cycle.</p>
<p>For more information on deprecations in Ember, see the <a href="/deprecations">main deprecations page</a>.</p>

{{deprecation-article model=model}}
{{#each model as |deprecation|}}
{{deprecation-article model=deprecation}}
{{/each}}
7 changes: 6 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const StaticSiteJson = require('broccoli-static-site-json');
const BroccoliMergeTrees = require('broccoli-merge-trees');

const jsonTree = new StaticSiteJson(`content/ember/v2`, {});
const jsonTree = new StaticSiteJson(`content/ember/v2`, {
collections: [{
src: 'content/ember/v2',
output: 'ember-v2.json',
}]
});

module.exports = function(defaults) {
let app = new EmberApp(defaults, {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"broccoli-static-site-json": "^1.0.3",
"broccoli-static-site-json": "^1.1.0",
"ember-ajax": "^3.0.0",
"ember-cli": "~2.16.2",
"ember-cli-app-version": "^3.0.0",
Expand Down

0 comments on commit a06898d

Please sign in to comment.