Skip to content

Commit

Permalink
Remove ds-links-in-record-array feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bmac committed Oct 18, 2016
1 parent 9593e17 commit 269f05f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export default RecordArray.extend({
meta: cloneNull(payload.meta)
});

if (isEnabled('ds-links-in-record-array')) {
this.set('links', cloneNull(payload.links));
}
this.set('links', cloneNull(payload.links));

internalModels.forEach((record) => {
this.manager.recordArraysForRecord(record).add(this);
Expand Down
1 change: 0 additions & 1 deletion config/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ds-improved-ajax": true,
"ds-pushpayload-return": null,
"ds-extended-errors": null,
"ds-links-in-record-array": true,
"ds-overhaul-references": null,
"ds-payload-type-hooks": null,
"ds-check-should-serialize-relationships": null,
Expand Down
66 changes: 32 additions & 34 deletions tests/unit/adapter-populated-record-array-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,43 +104,41 @@ test("stores the metadata off the payload", function(assert) {
assert.equal(recordArray.get('meta.foo'), 'bar', 'expected meta.foo to be bar from payload');
});

if (isEnabled('ds-links-in-record-array')) {
test('stores the links off the payload', function(assert) {
var recordArray = store.recordArrayManager
.createAdapterPopulatedRecordArray(store.modelFor('person'), null);
var payload = {
data: [{
type: 'person',
id: '1',
attributes: {
name: 'Scumbag Dale'
}
}, {
type: 'person',
id: '2',
attributes: {
name: 'Scumbag Katz'
}
}, {
type: 'person',
id: '3',
attributes: {
name: 'Scumbag Bryn'
}
}],
links: {
first: '/foo?page=1'
test('stores the links off the payload', function(assert) {
var recordArray = store.recordArrayManager
.createAdapterPopulatedRecordArray(store.modelFor('person'), null);
var payload = {
data: [{
type: 'person',
id: '1',
attributes: {
name: 'Scumbag Dale'
}
};

run(function() {
var records = store.push(payload);
recordArray.loadRecords(records, payload);
});
}, {
type: 'person',
id: '2',
attributes: {
name: 'Scumbag Katz'
}
}, {
type: 'person',
id: '3',
attributes: {
name: 'Scumbag Bryn'
}
}],
links: {
first: '/foo?page=1'
}
};

assert.equal(recordArray.get('links.first'), '/foo?page=1', 'expected links.first to be "/foo?page=1" from payload');
run(function() {
var records = store.push(payload);
recordArray.loadRecords(records, payload);
});
}

assert.equal(recordArray.get('links.first'), '/foo?page=1', 'expected links.first to be "/foo?page=1" from payload');
});

test('recordArray.replace() throws error', function(assert) {
var recordArray = store.recordArrayManager
Expand Down

0 comments on commit 269f05f

Please sign in to comment.