This conditional could be simplified to `record.get('isDirty')`