-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly deprecate removed properties
- Loading branch information
1 parent
c828d75
commit ef0fdca
Showing
3 changed files
with
22 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import Model from 'ember-data/model'; | ||
import attr from 'ember-data/attr'; | ||
import { hasMany } from 'ember-data/relationships'; | ||
import { deprecate } from '@ember/application/deprecations'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default Model.extend({ | ||
login: attr('string'), | ||
name: attr('string'), | ||
avatarUrl: attr('string'), | ||
|
||
members: hasMany('github-member', { inverse: null }), | ||
repositories: hasMany('github-repository') | ||
members: hasMany('github-member'), | ||
repositories: hasMany('github-repository'), | ||
|
||
githubUsers: computed(function() { | ||
deprecate('The githubUsers property on the github-organization model has been deprecated. Please use the members property.', false, { id: 'ember-data-github.deprecated-model-props', until: '1.0.0' }); | ||
return this.get('members'); | ||
}), | ||
githubRepositories: computed(function() { | ||
deprecate('The githubRepositories property on the github-organization model has been deprecated. Please use the repositories property.', false, { id: 'ember-data-github.deprecated-model-props', until: '1.0.0' }); | ||
return this.get('repositories'); | ||
}) | ||
}); |
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