Fixed strange RecordReadOnly exception in task done.

This commit is contained in:
benni 2012-12-16 14:13:54 +01:00
parent cabcd201a6
commit 0fcd5abb3a
2 changed files with 2 additions and 1 deletions

View file

@ -99,7 +99,7 @@ class Task < ActiveRecord::Base
def update_ordergroup_stats
if done
users.each { |u| u.ordergroup.update_stats! if u.ordergroup }
Ordergroup.joins(:users).where(users: {id: user_ids}).each(&:update_stats!)
end
end
end