instead of a update_all, perform an individual update during issue#move to trigger the update of the costs based on new rates

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@934 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 7376e9abb8
commit 94198314de
  1. 15
      lib/costs_time_entry_patch.rb

@ -42,6 +42,21 @@ module CostsTimeEntryPatch
yield
end
end
def update_all(updates, conditions = nil, options = {})
# instead of a update_all, perform an individual update during issue#move
# to trigger the update of the costs based on new rates
if conditions.keys == [:issue_id] && updates =~ /^project_id = ([\d]+)$/
project_id = $1
time_entries = TimeEntries.all(:conditions => conditions)
time_entries.each do |entry|
entry.project_id = project_id
entry.save!
end
else
super
end
end
end
module InstanceMethods

Loading…
Cancel
Save