ember-cli-scaffold
ember-cli-scaffold copied to clipboard
Support for DataStore imports and syntax
This is what the scaffold gives me:
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
export default Model.extend({ [..] });
This is what my model ended up looking after following the Ember official documentation:
import DS from 'ember-data';
const { attr, hasMany } = DS;
export default DS.Model.extend({
name: attr('string'),
products: hasMany('product')
});
For consistency ember generate scaffold
delegates the model creation to ember generate model
.
I think that creating some option to customize the import will not give any benefit, and make things more confuse. Maybe the ember documentation should be updated to use this new syntax.