From b47dde7fb1aa729cfa89736c2433026e27e1266e Mon Sep 17 00:00:00 2001 From: hjust Date: Fri, 14 May 2010 11:51:55 +0000 Subject: [PATCH] Fixed: do not issue an error if cost_object on issue is nil git-svn-id: https://dev.finn.de/svn/cockpit/trunk@1056 7926756e-e54e-46e6-9721-ed318f58905e --- lib/costs_issue_patch.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/costs_issue_patch.rb b/lib/costs_issue_patch.rb index 02044553c5..6227f35e8f 100644 --- a/lib/costs_issue_patch.rb +++ b/lib/costs_issue_patch.rb @@ -30,7 +30,9 @@ module CostsIssuePatch module InstanceMethods def validate_with_cost_object if cost_object_id_changed? - errors.add :cost_object_id, :activerecord_error_invalid unless project.cost_object_ids.include? cost_object_id + unless cost_object_id.blank? || project.cost_object_ids.include? cost_object_id + errors.add :cost_object_id, :activerecord_error_invalid + end ## disabled for now, implements part of ticket blocking # if cost_object_id_was.nil?