From 889058676be655a103236ceec577eba7cff574cb Mon Sep 17 00:00:00 2001 From: Danil Tashkinov Date: Wed, 21 May 2014 17:20:27 +0400 Subject: do not clear category on project change --- app/models/issue.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/issue.rb b/app/models/issue.rb index 3a3373f..53baa9c 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -468,6 +468,10 @@ class Issue < ActiveRecord::Base attrs['custom_fields'] = attrs['custom_fields'].reject {|c| !editable_custom_field_ids.include?(c['id'].to_s)} end + if (c_id = attrs.delete('category_id')) && safe_attribute?('category_id') + self.category_id = c_id if project && project.issue_category_ids.include?(c_id.to_i) + end + # mass-assignment security bypass assign_attributes attrs, :without_protection => true end -- 1.8.4.2