Commit Graph

6 Commits

Author SHA1 Message Date
Piotr Sarnacki
fbe384d5ae Fix key for repo relationship for V3 API 2015-11-18 17:05:32 +01:00
Piotr Sarnacki
bd3b62c264 Fix handling branches
This commit fixes handling of branches when using both V3 and V2. The
changes include:

  * proper definition of relationships that reflect V3 structure, so for
    example build belongs to a branch
  * setting up inverse records for some of the relationships. without
    doing that Ember Data can handle relationships in a surprising way,
    for example if the same record is referenced in 2 places in a
    belongsTo relationship, Ember Data will remove one of the references
    without proper inverse definitions
  * we need to add id when extracting branch as a relationship. Ember
    Data expects all of the relationships to have an id
  * lastly, we need to mimic the structure of the V3 API in V2 payloads,
    so for a build payload I'm now creating a branch record
2015-11-18 17:00:34 +01:00
Piotr Sarnacki
8956dedeaf Attribute mappings in serializers should use underscore notation 2015-11-11 16:24:23 +01:00
Piotr Sarnacki
c072738d58 Use job_ids as a key for jobs relationship for build 2015-11-11 15:37:55 +01:00
Piotr Sarnacki
0ceb677aed Don't add commit data to included array in build serializer
We already do it in an abstracted way (ie. for all relationships) in v2
fallback serializer.
2015-11-11 15:17:04 +01:00
Piotr Sarnacki
f09742abe1 Convert build serializer to javascript 2015-11-11 11:52:29 +01:00