summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-06-27 09:02:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-06-27 09:02:24 +0000
commitbc9ca5fcfd74ea699ea816aaf9e38edadd37b784 (patch)
tree34714c20aeeb5b6e252909f06b18e111a3ae209f /test/object_helpers.rb
parent5b1fb525b81583c874991991ba00ed946719974f (diff)
downloadredmine-bc9ca5fcfd74ea699ea816aaf9e38edadd37b784.tar.gz
redmine-bc9ca5fcfd74ea699ea816aaf9e38edadd37b784.zip
Disallow users to delete a version referenced by a custom field (#20159).
git-svn-id: http://svn.redmine.org/redmine/trunk@14376 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 7061e75c1..74f82b68b 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -125,6 +125,7 @@ module ObjectHelpers
@generated_version_name.succ!
version = Version.new(attributes)
version.name = @generated_version_name.dup if version.name.blank?
+ version.project ||= Project.find(1)
yield version if block_given?
version.save!
version