summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-12 16:55:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-12 16:55:30 +0000
commit3d4d6c31f3b225b2c588cde559730515c2e246ff (patch)
tree2f3dabc647defd0077ee11c190100ea1e072c553 /app
parent4c2c426af75f1db02d6ae4b0d75a602f8fa9de3a (diff)
downloadredmine-3d4d6c31f3b225b2c588cde559730515c2e246ff.tar.gz
redmine-3d4d6c31f3b225b2c588cde559730515c2e246ff.zip
Merged r15318 and r15319 (#22342).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15329 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index cf657d63a..ae3dd103a 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -302,16 +302,17 @@ class Issue < ActiveRecord::Base
# * or if the status was not part of the new tracker statuses
# * or the status was nil
def tracker=(tracker)
- if tracker != self.tracker
- if status == default_status
+ tracker_was = self.tracker
+ association(:tracker).writer(tracker)
+ if tracker != tracker_was
+ if status == tracker_was.try(:default_status)
self.status = nil
elsif status && tracker && !tracker.issue_status_ids.include?(status.id)
self.status = nil
end
- @custom_field_values = nil
+ reassign_custom_field_values
@workflow_rule_by_attribute = nil
end
- association(:tracker).writer(tracker)
self.status ||= default_status
self.tracker
end
@@ -355,7 +356,7 @@ class Issue < ActiveRecord::Base
unless valid_parent_project?
self.parent_issue_id = nil
end
- @custom_field_values = nil
+ reassign_custom_field_values
@workflow_rule_by_attribute = nil
end
# Set fixed_version to the project default version if it's valid