summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-06 20:46:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-06 20:46:45 +0000
commit6d974eb0188623a42971c120f1b1af6cf832e8d6 (patch)
treea68ab5674cd0d4bf2ba640de54359c2e2f9f86fb /app/models/issue.rb
parentf3a2c8d7f72a87904157db6d37622adf3395846d (diff)
downloadredmine-6d974eb0188623a42971c120f1b1af6cf832e8d6.tar.gz
redmine-6d974eb0188623a42971c120f1b1af6cf832e8d6.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8527 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb15
1 files changed, 2 insertions, 13 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 366f902f4..0427608ba 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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)