From 165373575883c3ca377d0d9d5ee0780cd0b09b24 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 Jan 2012 18:02:02 +0000 Subject: Deprecated Issue#move_to_project. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8539 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/models/issue.rb') 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 -- cgit v1.2.3