travis-web/app/serializers
Piotr Sarnacki 147ab06fcf Fix references in V3 payloads
V3 API doesn't return any of the records more than 2 times. If a record
is already included in the response any other occurences will be
represented as a reference, ie. a hash with just an @href. Ember Data
doesn't play nice with such references as it needs an id to identify a
record.

The code in this commit traverses payloads from V3 API and adds an id to
each of the references that are present.

For example a following payload:

    {
      "@href": "/build/1",
      "@type": "build"
      "id": 1,
      "state": "passed",
      "branch": {
        "@href": "/repo/1/branch/master",
        "name": "master",
        "lastBuild": {
          "@href": "/build/1"
        }
      }
    }

Will be changed to:

    {
      "@href": "/build/1",
      "@type": "build"
      "id": 1,
      "state": "passed",
      "branch": {
        "@href": "/repo/1/branch/master",
        "name": "master",
        "lastBuild": {
          "@href": "/build/1",
          "id": 1
        }
      }
    }

In this case an "id" field was added to "branch.lastBuild" field.
2015-12-08 10:18:06 +01:00
..
account.coffee Add ember-cli version of the Ember.js app 2015-02-03 09:48:22 +01:00
application.coffee Create adapters and serializers working with v3 and v2 APIs 2015-12-08 10:18:02 +01:00
branch.js Use lastBuild from defaultBranch on repository 2015-12-08 10:18:02 +01:00
build.js Attribute mappings in serializers should use underscore notation 2015-12-08 10:18:04 +01:00
env-var.coffee Add ember-cli version of the Ember.js app 2015-02-03 09:48:22 +01:00
job.coffee Attribute mappings in serializers should use underscore notation 2015-12-08 10:18:04 +01:00
repo.js app/serializers/repo.coffee -> app/serializers/repo.js 2015-12-08 10:18:05 +01:00
request.coffee Attribute mappings in serializers should use underscore notation 2015-12-08 10:18:04 +01:00
v2_fallback.js Disable dashboard test for now 2015-12-08 10:18:05 +01:00
v3.js Fix references in V3 payloads 2015-12-08 10:18:06 +01:00