js/libs/ember-1.5.1.js
function serialize(handler, model, names) {
      var object = {};
      if (isParam(model)) {
        object[names[0]] = model;
        return object;
      }

      // Use custom serialize if it exists.
      if (handler.serialize) {
        return handler.serialize(model, names);
      }

      if (names.length !== 1) { return; }

      var name = names[0];

      if (/_id$/.test(name)) {
        object[name] = model.id;
      } else {
        object[name] = model;
      }
      return object;
    }
function serialize(handler, model, names) {
      var object = {};
      if (isParam(model)) {
        object[names[0]] = model;
        return object;
      }

      // Use custom serialize if it exists.
      if (handler.serialize) {
        return handler.serialize(model, names);
      }

      if (names.length !== 1) { return; }

      var name = names[0];

      if (/_id$/.test(name)) {
        object[name] = model.id;
      } else {
        object[name] = model;
      }
      return object;
    }
@private

Serializes a handler using its custom `serialize` method or
by a default that looks up the expected property name from
the dynamic segment.

@param {Object} handler a router handler
@param {Object} model the model to be serialized for this handler
@param {Array[Object]} names the names array attached to an
handler object returned from router.recognizer.handlersFor()