What is the best practice of setting the attribute types within DS.Model?

Say I have a DS.Model class. Is it best practice to specify the attribute type or would it be better for Ember to determine what the type is?


export default DS.Model.extend({
  myAttr: DS.attr('string')


export default DS.Model.extend({
  myAttr: DS.attr()


No reply? :cry:

I’m genuinely interested in the answer.

DS.attr type is used to validate incoming data. You can leave it unspecified if you are unsure what type of data will be stored in the attribute.

Ember will throw error if you’ll try to store a string in DS.attr(‘number’).