Skip to content

Commit bbc44c8

Browse files
committed
add another 'shouldRefreshRelation' case
1 parent 81976e1 commit bbc44c8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

backbone.JJRelational.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ do () ->
529529
shouldRefreshRelation = isRelation and (unset or
530530
(currValue == null) or
531531
(_.isNumber(currValue) and _.isNumber(value) and currValue != value) or
532-
(!_.isObject(value) and _.isObject(currValue) and currValue.id != value) or
532+
(!_.isObject(value) and _.isObject(currValue) and currValue.id and currValue.id != value) or
533+
(_.isObject(value) and _.isObject(currValue) and currValue.id and value.id and currValue.id != value.id) or
533534
(value instanceof Backbone.Model and value.cid != currValue.cid) or
534535
(_.isArray(value) && (!_.isEqual(value, currValue) or currValue instanceof Backbone.Collection)))
535536

backbone.JJRelational.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backbone.JJRelational.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)