summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-03-26 11:05:20 +0000
committerGo MAEDA <maeda@farend.jp>2019-03-26 11:05:20 +0000
commitf0d579adebfe3c5da93135fbaa3d9ec503d06855 (patch)
tree68bc39cd66177ff0c711384335019f42f66f95cf /app/models
parent391c069d87588dfccda7b308c1a4c808611a3b65 (diff)
downloadredmine-f0d579adebfe3c5da93135fbaa3d9ec503d06855.tar.gz
redmine-f0d579adebfe3c5da93135fbaa3d9ec503d06855.zip
Fix that deleting a version silently deletes its attachments (#31087).
Patch by Karel Pičman and Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@18008 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/version.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/version.rb b/app/models/version.rb
index 66d1a8070..3c62580f9 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -353,7 +353,7 @@ class Version < ActiveRecord::Base
end
def deletable?
- fixed_issues.empty? && !referenced_by_a_custom_field?
+ fixed_issues.empty? && !referenced_by_a_custom_field? && attachments.empty?
end
def default_project_version