]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 6 Jan 2012 20:46:45 +0000 (20:46 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 6 Jan 2012 20:46:45 +0000 (20:46 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8527 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index 366f902f40d304311df8a8cad8fbad95d8edc5cf..0427608ba65f56090021220c292d6cbfa56bf8f2 100644 (file)
@@ -138,15 +138,7 @@ class Issue < ActiveRecord::Base
 
   # Moves/copies an issue to a new project and tracker
   # Returns the moved/copied issue on success, false on failure
-  def move_to_project(*args)
-    ret = Issue.transaction do
-      move_to_project_without_transaction(*args) || raise(ActiveRecord::Rollback)
-    end || false
-  end
-
-  def move_to_project_without_transaction(new_project, new_tracker = nil, options = {})
-    options ||= {}
-
+  def move_to_project(new_project, new_tracker=nil, options={})
     if options[:copy]
       issue = self.class.new.copy_from(self)
     else
@@ -164,10 +156,7 @@ class Issue < ActiveRecord::Base
       issue.attributes = options[:attributes]
     end
 
-    unless issue.save
-      return false
-    end
-    issue
+    issue.save ? issue : false
   end
 
   def status_id=(sid)