From fea6ceaf96d52391410aeb89aab45d354bcc833a Mon Sep 17 00:00:00 2001 From: Caio Almeida <117518+caiosba@users.noreply.github.com> Date: Sun, 18 Aug 2024 11:16:43 -0300 Subject: [PATCH 1/2] Delete `ExplainerItem` when `ProjectMedia` is destroyed. (#1995) Fixes an issue reported by Sentry. Fixes: CV2-5099. --- app/models/concerns/project_media_associations.rb | 2 +- test/models/explainer_test.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/project_media_associations.rb b/app/models/concerns/project_media_associations.rb index ca52f8f980..40378101ab 100644 --- a/app/models/concerns/project_media_associations.rb +++ b/app/models/concerns/project_media_associations.rb @@ -21,7 +21,7 @@ module ProjectMediaAssociations has_one :claim_description, dependent: :destroy belongs_to :source, optional: true has_many :tipline_requests, as: :associated - has_many :explainer_items + has_many :explainer_items, dependent: :destroy has_many :explainers, through: :explainer_items has_annotations end diff --git a/test/models/explainer_test.rb b/test/models/explainer_test.rb index cce9645166..a902379b6c 100644 --- a/test/models/explainer_test.rb +++ b/test/models/explainer_test.rb @@ -110,4 +110,14 @@ def setup ex.description = 'Now this is the only paragraph' ex.save! end + + test "should destroy explainer items when project media is destroyed" do + t = create_team + ex = create_explainer team: t + pm = create_project_media team: t + pm.explainers << ex + assert_difference 'ExplainerItem.count', -1 do + pm.destroy! + end + end end From 3534a02a5e76ee28bf1e943827adc7fdf563be2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:11:51 +0200 Subject: [PATCH 2/2] Bump fugit from 1.5.2 to 1.11.1 (#1997) Bumps [fugit](https://github.com/floraison/fugit) from 1.5.2 to 1.11.1. - [Changelog](https://github.com/floraison/fugit/blob/master/CHANGELOG.md) - [Commits](https://github.com/floraison/fugit/compare/v1.5.2...v1.11.1) --- updated-dependencies: - dependency-name: fugit dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff4d48122e..160a12b73b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -243,7 +243,7 @@ GEM encryptor (3.0.0) equalizer (0.0.11) erubi (1.12.0) - et-orbi (1.2.7) + et-orbi (1.2.11) tzinfo ethon (0.16.0) ffi (>= 1.15.0) @@ -302,8 +302,8 @@ GEM fog-core nokogiri (>= 1.5.11, < 2.0.0) formatador (1.1.0) - fugit (1.5.2) - et-orbi (~> 1.1, >= 1.1.8) + fugit (1.11.1) + et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) fx (0.8.0) activerecord (>= 6.0.0)