From 08e714eb3bfc52683305997e735fe893026b1ef4 Mon Sep 17 00:00:00 2001 From: Artem Charykov Date: Fri, 19 Jun 2015 14:12:26 +0300 Subject: [PATCH] AMS modelNameFromPayloadKey and serializePolymorphicType cleanup --- .../lib/system/active-model-serializer.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/activemodel-adapter/lib/system/active-model-serializer.js b/packages/activemodel-adapter/lib/system/active-model-serializer.js index c7822a22a9d..f14eb031fae 100644 --- a/packages/activemodel-adapter/lib/system/active-model-serializer.js +++ b/packages/activemodel-adapter/lib/system/active-model-serializer.js @@ -176,9 +176,7 @@ var ActiveModelSerializer = RESTSerializer.extend({ if (Ember.isNone(belongsTo)) { json[jsonKey] = null; } else { - json[jsonKey] = classify(belongsTo.modelName).replace(/(\/)([a-z])/g, function(match, separator, chr) { - return match.toUpperCase(); - }).replace('/', '::'); + json[jsonKey] = classify(belongsTo.modelName).replace('/', '::'); } }, @@ -295,9 +293,7 @@ var ActiveModelSerializer = RESTSerializer.extend({ } }, modelNameFromPayloadKey: function(key) { - var convertedFromRubyModule = camelize(singularize(key)).replace(/(^|\:)([A-Z])/g, function(match, separator, chr) { - return match.toLowerCase(); - }).replace('::', '/'); + var convertedFromRubyModule = singularize(key.replace('::', '/')); return normalizeModelName(convertedFromRubyModule); } });