Fixed: 500 during deletion of s labor_budget_item

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@1020 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent efe8ad2fa1
commit 76d2b35dd4
  1. 2
      app/models/variable_cost_object.rb

@ -97,8 +97,8 @@ class VariableCostObject < CostObject
labor_budget_items.reject(&:new_record?).each do |labor_budget_item|
attributes = labor_budget_item_attributes[labor_budget_item.id.to_s]
attributes[:budget] = Rate.clean_currency(attributes[:budget])
if attributes && attributes[:hours].to_i > 0 && attributes[:user_id].to_i > 0
attributes[:budget] = Rate.clean_currency(attributes[:budget])
labor_budget_item.attributes = attributes
else
labor_budget_items.delete(labor_budget_item)

Loading…
Cancel
Save