 
       #jshint loopfunc:true
       for hash in payload[prop]
-        # hash.foobar = 'hello!'
-        # custom code starts here
-        typeName = if hash.type
-          hash.qualified_type = hash.type
-          hash.type = hash.type.replace(/.+::/, '')
-          @typeForRoot hash.type
-        else
-          @typeForRoot prop
-        # custom code ends here
+        # ===========> custom code for namespacing and sti starts here
+        hash = @normalizeType(hash)
+        typeName = @extractTypeName(prop, hash)
+        # <=========== custom code for namespacing and sti ends here
         type = store.modelFor(typeName)
         typeSerializer = store.serializerFor(type)
         hash = typeSerializer.normalize(type, hash, prop)


    primaryRecord

ETahi.PaperReviewerTaskSerializer = ETahi.TaskSerializer.extend()
ETahi.PaperEditorTaskSerializer = ETahi.TaskSerializer.extend()
ETahi.PaperAdminTaskSerializer = ETahi.TaskSerializer.extend()

  coerceId: (id) ->
    (if not id? then null else id + "")

  normalizeType: (hash) ->
    if hash.type
      hash.qualified_type = hash.type
      hash.type = hash.type.replace(/.+::/, '')
    hash

  extractTypeName: (prop, hash) ->
    if hash.type
      @typeForRoot hash.type
    else
      @typeForRoot prop

  # This is overridden because finding a 'task' and getting back a root key of 'author_task' will
  # break the isPrimary check.
  extractSingle: (store, primaryType, payload, recordId, requestType) ->
