DS.Transform documentation


#1

Looking at the documentation on transforms and assuming there is a copy error: http://emberjs.com/api/data/classes/DS.Transform.html The “example” and “usage” blocks don’t match:

Example

// Converts centigrade in the JSON to fahrenheit in the app
App.TemperatureTransform = DS.Transform.extend({
  deserialize: function(serialized) {
    return (serialized *  1.8) + 32;
  },
  serialize: function(deserialized) {
    return (deserialized - 32) / 1.8;
  }
});

Usage

var attr = DS.attr;
App.Requirement = DS.Model.extend({
  name: attr('string'),
  optionsArray: attr('raw')
});

Is the usage block supposed to be demonstrating attr(‘temperature-transform’)?

The old documentation was apparently http://stackoverflow.com/a/14842514/128508. Perhaps the new usage block is not there.