Deprecated Issue#move_to_project.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8539 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-07 18:02:02 +00:00
parent 065376c160
commit 1653735758
4 changed files with 81 additions and 62 deletions
+10 -1
View File
@@ -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