-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update blueprints to import modules directly
- Import JSONAPIAdapter module directly in blueprint - Import JSONAPISerializer module directly in blueprint - Import Transform module directly in blueprint - Import attr module directly in model blueprints when needed - Import belongsTo and hasMany modules directly in blueprints when needed
- Loading branch information
1 parent
fb9f4f1
commit bcab3b5
Showing
9 changed files
with
102 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import DS from 'ember-data'; | ||
<%= importStatements %> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
export default DS.Model.extend({ | ||
export default Model.extend({ | ||
<%= attrs %> | ||
}); |
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,4 @@ | ||
import DS from 'ember-data'; | ||
import JSONAPISerializer from 'ember-data/serializers/json-api'; | ||
|
||
export default DS.JSONAPISerializer.extend({ | ||
export default JSONAPISerializer.extend({ | ||
}); |
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
I think I get the general motivation here (and recognizing the desire not to create jshint errors with a blueprint) but this feels like a less useful default to me than just:
import DS from 'ember-data';
Maybe I'm just not pro enough, but I tend to just:
ember g model my-model
which gives me
import Model from 'ember-data/model';
I then consistently change the code back to the old default.
Is there a use case for a
DS.Model
without anyDS.attr
s?