only save issue on after save hook if the issue was not changed yet. (#13244)

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@302 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 574658d29f
commit 4796a74c33
  1. 4
      app/models/cost_entry.rb
  2. 4
      lib/time_entry_patch.rb

@ -39,8 +39,8 @@ class CostEntry < ActiveRecord::Base
def before_save
self.spent_on &&= spent_on.to_date
update_costs
issue.save
result = update_costs
return issue.changed? ? result : issue.save
end
# tyear, tmonth, tweek assigned where setting spent_on attributes

@ -24,8 +24,8 @@ module TimeEntryPatch
module InstanceMethods
def before_save
update_costs
issue.save
result = update_costs
return issue.changed? ? result : issue.save
end
def real_costs

Loading…
Cancel
Save