Skip to content

Commit

Permalink
Merge branch 'develop' into feature/CV2-5067-CV2-4979-export-list
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Aug 20, 2024
2 parents acbe054 + 3534a02 commit 5c1fdcb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/project_media_associations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions test/models/explainer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5c1fdcb

Please sign in to comment.