File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/dirty/checking
grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -91,18 +91,13 @@ trait DirtyCheckable {
9191 if ( $changedProperties != null && ! $changedProperties. containsKey(propertyName)) {
9292 boolean isNull = newValue == null
9393 if ((isNull && oldValue != null ) ||
94- (! isNull && oldValue == null ) ||
95- (! isNull && (newOldOrOldValueIsProxy(newValue, oldValue) && newValue. getAt(" id" ) != oldValue. getAt(" id" )
96- || (! newOldOrOldValueIsProxy(newValue, oldValue) && ! newValue. equals(oldValue))))) {
94+ (! isNull && oldValue == null ) ||
95+ (! isNull && ! newValue. equals(oldValue))) {
9796 $changedProperties. put propertyName, oldValue
9897 }
9998 }
10099 }
101100
102- boolean newOldOrOldValueIsProxy(newValue, oldValue) {
103- (newValue instanceof EntityProxy || oldValue instanceof EntityProxy )
104- }
105-
106101 /**
107102 * @return A list of the dirty property names
108103 */
Original file line number Diff line number Diff line change @@ -162,6 +162,15 @@ class DirtyCheckingSpec extends GormDatastoreSpec {
162162@Entity
163163class TestAuthor {
164164 String name
165+
166+ @Override
167+ boolean equals (o ) {
168+ if (! (o instanceof TestAuthor )) return false
169+ if (this . is(o)) return true
170+ TestAuthor that = (TestAuthor ) o
171+ if (id != null && that. id != null ) return id == that. id
172+ return false
173+ }
165174}
166175
167176@Entity
You can’t perform that action at this time.
0 commit comments