@@ -246,33 +246,6 class Issue < ActiveRecord::Base | |||
|
246 | 246 | @copied_from.present? |
|
247 | 247 | end |
|
248 | 248 | |
|
249 | # Moves/copies an issue to a new project and tracker | |
|
250 | # Returns the moved/copied issue on success, false on failure | |
|
251 | def move_to_project(new_project, new_tracker=nil, options={}) | |
|
252 | ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead." | |
|
253 | ||
|
254 | if options[:copy] | |
|
255 | issue = self.copy | |
|
256 | else | |
|
257 | issue = self | |
|
258 | end | |
|
259 | ||
|
260 | issue.init_journal(User.current, options[:notes]) | |
|
261 | ||
|
262 | # Preserve previous behaviour | |
|
263 | # #move_to_project doesn't change tracker automatically | |
|
264 | issue.send :project=, new_project, true | |
|
265 | if new_tracker | |
|
266 | issue.tracker = new_tracker | |
|
267 | end | |
|
268 | # Allow bulk setting of attributes on the issue | |
|
269 | if options[:attributes] | |
|
270 | issue.attributes = options[:attributes] | |
|
271 | end | |
|
272 | ||
|
273 | issue.save ? issue : false | |
|
274 | end | |
|
275 | ||
|
276 | 249 | def status_id=(status_id) |
|
277 | 250 | if status_id.to_s != self.status_id.to_s |
|
278 | 251 | self.status = (status_id.present? ? IssueStatus.find_by_id(status_id) : nil) |
General Comments 0
You need to be logged in to leave comments.
Login now