Skip to content

Commit 8caa148

Browse files
committed
Write byline, dateline if relationships change
This is a somewhat debatable change. Positively, it will write a byline (`LastModified`) and dateline (`LastModifiedBy`) if only the relationships have changed, even if no attributes have changed, thus providing a more accurate record and, to a degree, improved auditing. Negatively, it will create phantom versions, since relationships aren't otherwise versioned; if a user rolls back to such a version, the relationships themselves won't be rolled back.
1 parent 72fb0b5 commit 8caa148

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ SqlDateTime version
340340
var isNew = topic.Id == -1;
341341
var areReferencesResolved = true;
342342
var areRelationshipsDirty = topic.Relationships.IsDirty();
343-
var areAttributesDirty = topic.Attributes.IsDirty(excludeLastModified: true);
343+
var areAttributesDirty = topic.Attributes.IsDirty(excludeLastModified: !areRelationshipsDirty);
344344
var extendedAttributeList = GetAttributes(topic, isExtendedAttribute: true);
345345
var indexedAttributeList = GetAttributes(
346346
topic : topic,

0 commit comments

Comments
 (0)