You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a record is deleted before_destroy :check_dependencies is run, which avoids deleting the record if another one is pointing to it (referring_* relations, i.e. a source is deleted and a work is pointing to it). check_dependencies works reasonably well for Sources, but in other cases (ex. People) it will include also relations that are not referring_*, for example having the tag 510 in a Person will trigger the dependency on Institution (not the referring one!), which should be cleaned up automatically. Moreover non-marc records are not included at all, so for example the links to Places are not taken care of at all, leaving dangling links in the database.
The functionality needs to be restructured so that only referring_* relations are taken in account and also eventual non-marc models.
The second part of the problem is that relations are cleaned up automatically only for Sources (deleting a source will delete all the references it had), but not necessarily for other methods (hence the Place link stays when a Person is deleted). This functionality needs to be unified across models.
The text was updated successfully, but these errors were encountered:
When a record is deleted
before_destroy :check_dependencies
is run, which avoids deleting the record if another one is pointing to it (referring_* relations, i.e. a source is deleted and a work is pointing to it).check_dependencies
works reasonably well for Sources, but in other cases (ex. People) it will include also relations that are notreferring_*
, for example having the tag 510 in a Person will trigger the dependency on Institution (not the referring one!), which should be cleaned up automatically. Moreover non-marc records are not included at all, so for example the links to Places are not taken care of at all, leaving dangling links in the database.The functionality needs to be restructured so that only
referring_*
relations are taken in account and also eventual non-marc models.The second part of the problem is that relations are cleaned up automatically only for Sources (deleting a source will delete all the references it had), but not necessarily for other methods (hence the Place link stays when a Person is deleted). This functionality needs to be unified across models.
The text was updated successfully, but these errors were encountered: