-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move declaration of DETECTOR_VERSION upstream
** Why are these changes being introduced: We initially tried populating the detector_version value in the Detection and Categorization records within those models themselves via a before_create lifecycle hook. That proved unworkable because the app ends up calling .find_by_or_create, and the "find" part of that pathway has no relevant lifecycle hook to pick up the current value. This caused a bug that would have prevented the anticipated creation of new records when we bump the DETECTOR_VERSION env variable. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/tco-90 ** How does this address that need: This abandons the attempt to populate detector_version via a lifecycle hook, and moves that responsibility to the models which initiate the creation of these records (where they are already defining the other needed fields). Because these values are now being defined upstream, the lifecycle hook is no longer needed, so we remove it. Removing this lifecycle hook causes some other tests to fail. Some of those tests need to be updated to _also_ define detector_version, while a test about that auto-population feature is just deleted as no longer relevant. ** Document any side effects to this change: No side effects other than our code is a little less sparse than I was hoping for. Such is life.
- Loading branch information
1 parent
de1c5fe
commit 3962c5f
Showing
8 changed files
with
22 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters