This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump ember-cli-mirage to 0.4.2 (#969)
closes TryGhost/Ghost#9433 - remove unnecessary bower deps - update mirage usage - fix tests
- Loading branch information
1 parent
e1e2d6e
commit c6ddf3e
Showing
19 changed files
with
170 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import {Model} from 'ember-cli-mirage'; | ||
import {Model, belongsTo} from 'ember-cli-mirage'; | ||
|
||
export default Model.extend({ | ||
role: belongsTo() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import {Model, belongsTo} from 'ember-cli-mirage'; | ||
import {Model, belongsTo, hasMany} from 'ember-cli-mirage'; | ||
|
||
export default Model.extend({ | ||
author: belongsTo('user') | ||
author: belongsTo('user'), | ||
tags: hasMany() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import {Model} from 'ember-cli-mirage'; | ||
import {Model, hasMany} from 'ember-cli-mirage'; | ||
|
||
export default Model.extend({ | ||
posts: hasMany() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import BaseSerializer from './application'; | ||
import {RestSerializer} from 'ember-cli-mirage'; | ||
|
||
export default BaseSerializer.extend({ | ||
embed: true, | ||
|
||
include(request) { | ||
if (request.queryParams.include && request.queryParams.include.indexOf('tags') >= 0) { | ||
return ['tags']; | ||
} | ||
|
||
return []; | ||
}, | ||
|
||
serialize(object, request) { | ||
if (this.isCollection(object)) { | ||
return BaseSerializer.prototype.serialize.apply(this, arguments); | ||
} | ||
|
||
let {post} = RestSerializer.prototype.serialize.call(this, object, request); | ||
|
||
if (object.author) { | ||
post.author = object.author.id; | ||
} | ||
|
||
return {posts: [post]}; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.