summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-07 18:02:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-07 18:02:02 +0000
commit165373575883c3ca377d0d9d5ee0780cd0b09b24 (patch)
tree54335ed9f15e5fcc09240181ad111e2d9e0eaa32 /app/models/issue.rb
parent065376c160b0bc3ca6cd59707a0395b8bff23de9 (diff)
downloadredmine-165373575883c3ca377d0d9d5ee0780cd0b09b24.tar.gz
redmine-165373575883c3ca377d0d9d5ee0780cd0b09b24.zip
Deprecated Issue#move_to_project.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8539 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index c9892c6f1..4e4deb5db 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -136,11 +136,20 @@ class Issue < ActiveRecord::Base
self
end
+ # Returns an unsaved copy of the issue
+ def copy(attributes=nil)
+ copy = self.class.new.copy_from(self)
+ copy.attributes = attributes if attributes
+ copy
+ end
+
# Moves/copies an issue to a new project and tracker
# Returns the moved/copied issue on success, false on failure
def move_to_project(new_project, new_tracker=nil, options={})
+ ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
+
if options[:copy]
- issue = self.class.new.copy_from(self)
+ issue = self.copy
else
issue = self
end