Skip to content

Commit 2c40362

Browse files
authored
Revert "force set refersTo property (#254)"
This reverts commit 73efa47.
1 parent 73efa47 commit 2c40362

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

data-model.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,10 +2621,6 @@ DataModel.prototype.inferMapping = function(name) {
26212621
}
26222622
//extend default mapping attributes
26232623
var mapping = _.assign(defaultMapping, field.mapping);
2624-
// set refersTo property if it's not defined in mapping
2625-
if (mapping.refersTo == null && mapping.associationType === 'junction') {
2626-
mapping.refersTo = field.name;
2627-
}
26282624

26292625
var associationAdapter;
26302626
if (mapping.associationType === 'junction' && mapping.associationAdapter && typeof mapping.associationObjectField === 'undefined') {
@@ -2633,7 +2629,7 @@ DataModel.prototype.inferMapping = function(name) {
26332629
if (associationAdapter) {
26342630
// try to find association adapter parent field
26352631
var associationParentAttr = _.find(associationAdapter.attributes, function (x) {
2636-
return (typeof x.primary === 'undefined' || x.primary === false) && x.type === mapping.parentModel;
2632+
return (x.primary === 'undefined' || x.primary === false) && x.type === mapping.parentModel;
26372633
});
26382634
if (associationParentAttr) {
26392635
mapping.associationObjectField = associationParentAttr.name;
@@ -2659,7 +2655,7 @@ DataModel.prototype.inferMapping = function(name) {
26592655
if (associationAdapter) {
26602656
// try to find association adapter parent field
26612657
var associationChildAttr = _.find(associationAdapter.attributes, function (x) {
2662-
return typeof (typeof x.primary === 'undefined' || x.primary === false) && x.type === mapping.childModel;
2658+
return typeof (x.primary === 'undefined' || x.primary === false) && x.type === mapping.childModel;
26632659
});
26642660
if (associationChildAttr) {
26652661
mapping.associationValueField = associationChildAttr.name;

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@themost/data",
3-
"version": "2.6.105",
3+
"version": "2.6.104",
44
"description": "MOST Web Framework Codename Blueshift - Data module",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)