Skip to content
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

Merged
merged 9 commits into from
Jul 25, 2024

Conversation

danielaboost
Copy link
Contributor

@danielaboost danielaboost commented Jul 25, 2024

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)

Copy link

Code quality score

Lovely, the code quality is unchanged for this PR 😊

Ruby file count Similarity score (flay) ABC complexity (flog) Code smells (reek) TOTALS
base 90 6.12 5.36 17.15 28.63
this branch 90 6.12 5.36 17.15 28.63
difference 0 0.0 0.0 0.0 0.0

@danielaboost danielaboost changed the title Dl/fix jobs tab Past jobs can still be viewed when an enrichment definition or harvest definition is removed Jul 25, 2024
@@ -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
Copy link
Contributor

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

Copy link
Contributor

@eoin-boost eoin-boost left a 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

@danielaboost danielaboost merged commit 20a7484 into main Jul 25, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants