Skip to content

Commit

Permalink
Revert "[RFC 403] Identifiers Infra (#6247)"
Browse files Browse the repository at this point in the history
This reverts commit 663856b.
  • Loading branch information
runspired committed Aug 1, 2019
1 parent 167185b commit 9472e75
Show file tree
Hide file tree
Showing 22 changed files with 120 additions and 864 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import EmberObject from '@ember/object';
import { attr, hasMany, belongsTo } from '@ember-data/model';
import { InvalidError, ServerError } from '@ember-data/adapter/error';
import { JsonApiValidationError } from '@ember-data/store/-private/ts-interfaces/record-data-json-api';
import RecordData from '@ember-data/store/-private/ts-interfaces/record-data';
import { RecordIdentifier } from '@ember-data/store/-private/ts-interfaces/identifier';
import RecordData, { RecordIdentifier } from '@ember-data/store/-private/ts-interfaces/record-data';
import { RECORD_DATA_ERRORS } from '@ember-data/canary-features';

class Person extends Model {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import Model from '@ember-data/model';
import testInDebug from 'dummy/tests/helpers/test-in-debug';
import DS from 'ember-data';
import { RecordData, recordDataFor, relationshipsFor, relationshipStateFor } from '@ember-data/store/-private';
import { identifierCacheFor } from '@ember-data/store/-private';
import { IDENTIFIERS } from '@ember-data/canary-features';

const { attr: DSattr, hasMany: DShasMany, belongsTo: DSbelongsTo } = DS;
const { hash } = RSVP;
Expand Down Expand Up @@ -1893,8 +1891,8 @@ module('integration/relationship/belongs_to Belongs-To Relationships', function(

test("belongsTo relationship doesn't trigger when model data doesn't support implicit relationship", function(assert) {
class TestRecordData extends RecordData {
constructor(...args) {
super(...args);
constructor(modelName, id, clientId, storeWrapper, store) {
super(modelName, id, clientId, storeWrapper, store);
delete this.__implicitRelationships;
delete this.__relationships;
}
Expand Down Expand Up @@ -1932,16 +1930,7 @@ module('integration/relationship/belongs_to Belongs-To Relationships', function(
const createRecordDataFor = env.store.createRecordDataFor;
env.store.createRecordDataFor = function(modelName, id, lid, storeWrapper) {
if (modelName === 'book1' || modelName === 'section') {
if (IDENTIFIERS) {
let identifier = identifierCacheFor(this).getOrCreateRecordIdentifier({
type: modelName,
id,
lid,
});
return new TestRecordData(identifier, storeWrapper);
} else {
return new TestRecordData(modelName, id, lid, storeWrapper);
}
return new TestRecordData(modelName, id, lid, storeWrapper, this);
}
return createRecordDataFor.call(this, modelName, id, lid, storeWrapper);
};
Expand Down
1 change: 0 additions & 1 deletion packages/canary-features/addon/default-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ export default {
SAMPLE_FEATURE_FLAG: null,
RECORD_DATA_ERRORS: null,
RECORD_DATA_STATE: null,
IDENTIFIERS: null,
};
Loading

0 comments on commit 9472e75

Please sign in to comment.