summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-11 17:17:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-11 17:17:29 +0000
commit1da39caad3d2bded1da854f44b99d902beca2494 (patch)
tree6f2e7f5c8439c6044aa91ee5465140607804f8b7 /app/models
parentbb2c6f607610442d6be8de893ff15ff715ceb0d7 (diff)
downloadredmine-1da39caad3d2bded1da854f44b99d902beca2494.tar.gz
redmine-1da39caad3d2bded1da854f44b99d902beca2494.zip
Code cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@15319 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index b433da30b..b45dc966f 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -303,17 +303,15 @@ class Issue < ActiveRecord::Base
# * or the status was nil
def tracker=(tracker)
tracker_was = self.tracker
+ association(:tracker).writer(tracker)
if tracker != tracker_was
- if status == default_status
+ if status == tracker_was.try(:default_status)
self.status = nil
elsif status && tracker && !tracker.issue_status_ids.include?(status.id)
self.status = nil
end
- @workflow_rule_by_attribute = nil
- end
- association(:tracker).writer(tracker)
- if tracker != tracker_was
reassign_custom_field_values
+ @workflow_rule_by_attribute = nil
end
self.status ||= default_status
self.tracker