Permalink
Browse files

Name change from enumeratedTransform to enumTransform

  • Loading branch information...
1 parent a73a2bd commit 72842a5ef9c0720d39dfa3cd48a3680bdef5433b @leepfrog leepfrog committed Jan 6, 2013
@@ -548,7 +548,7 @@ DS.Adapter = Ember.Object.extend(DS._Mappable, {
in your app, but you want to persist those as 0,1,2 in your backend.
You would first register the transform on your adapter instance:
- adapter.registerEnumeratedTransform('priority', ['low', 'medium', 'high']);
+ adapter.registerEnumTransform('priority', ['low', 'medium', 'high']);
You would then refer to the 'priority' DS.attr in your model:
App.Task = DS.Model.extend({
@@ -565,8 +565,8 @@ DS.Adapter = Ember.Object.extend(DS._Mappable, {
@param {Array} array of String objects to use for the enumerated values.
This is an ordered list and the index values will be used for the transform.
*/
- registerEnumeratedTransform: function(attributeType, objects) {
- get(this, 'serializer').registerEnumeratedTransform(attributeType, objects);
+ registerEnumTransform: function(attributeType, objects) {
+ get(this, 'serializer').registerEnumTransform(attributeType, objects);
},
/**
@@ -907,7 +907,7 @@ DS.Serializer = Ember.Object.extend({
this.transforms[type] = transform;
},
- registerEnumeratedTransform: function(type, objects) {
+ registerEnumTransform: function(type, objects) {
var transform = {
deserialize: function(deserialized) {
return objects.objectAt(deserialized);
@@ -118,10 +118,10 @@ test("the default date transform", function() {
});
-module("Enumerated Transforms", {
+module("Enum Transforms", {
setup: function() {
adapter = DS.Adapter.create();
- adapter.registerEnumeratedTransform('materials', ['unobtainium', 'kindaobtainium', 'veryobtainium']);
+ adapter.registerEnumTransform('materials', ['unobtainium', 'kindaobtainium', 'veryobtainium']);
store = DS.Store.create({
adapter: adapter

0 comments on commit 72842a5

Please sign in to comment.