-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Past jobs can still be viewed when an enrichment definition or harvest definition is removed #76
Conversation
Code quality scoreLovely, the code quality is unchanged for this PR 😊
|
@@ -7,7 +7,7 @@ class HarvestJob < ApplicationRecord | |||
belongs_to :pipeline_job | |||
belongs_to :harvest_definition | |||
belongs_to :extraction_job, optional: true | |||
has_one :harvest_report, dependent: :destroy | |||
has_one :harvest_report, dependent: nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi standard would agree with you it seems 😄
https://github.com/standardrb/standard-rails/blob/main/config/base.yml#L181
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good thank you @danielaboost
Reports were dependent on their enrichment definitions and harvest definitions, and they were being destroyed if the definition was deleted. This meant the reports tab was breaking as the report no longer existed.
We're fixed this by making reports an independent object, which copies the pipeline name that it belongs to (the only piece of data that was missing once the definition had been deleted)