File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 99 author 'Jens Krämer, Georepublic'
1010 author_url 'https://hub.georepublic.net/gtt/redmine_text_blocks'
1111 description 'Adds configurable text blocks for replying to issues'
12- version '1.0.0 '
12+ version '1.0.1 '
1313
1414 requires_redmine version_or_higher : '3.4.0'
1515
Original file line number Diff line number Diff line change 22
33module RedmineTextBlocks
44 def self . setup
5+ RedmineTextBlocks ::ProjectPatch . apply
56 ProjectsController . send :helper , RedmineTextBlocks ::ProjectSettingsTabs
67 IssuesController . send :helper , TextBlocksHelper
78 end
Original file line number Diff line number Diff line change 1+ module RedmineTextBlocks
2+ module ProjectPatch
3+ def self . apply
4+ Project . class_eval do
5+ has_many :text_blocks , dependent : :delete_all
6+ end
7+ end
8+ end
9+ end
Original file line number Diff line number Diff line change @@ -54,5 +54,12 @@ class TextBlockTest < ActiveSupport::TestCase
5454 assert_equal project , r . text_block . project
5555 end
5656 end
57+
58+ test 'deletion of project should delete textblocks' do
59+ RedmineTextBlocks ::SaveTextBlock . ( { name : 'test' } , project : @project )
60+ assert_difference 'TextBlock.count' , -1 do
61+ @project . destroy
62+ end
63+ end
5764end
5865
You can’t perform that action at this time.
0 commit comments