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
pull/6827/head
hjust 15 years ago
parent 16675993a9
commit b47dde7fb1
  1. 4
      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?

Loading…
Cancel
Save