Fixed bug in new ordergroup stats feature.
This commit is contained in:
parent
9f60a323ad
commit
84a026a677
1 changed files with 1 additions and 1 deletions
|
@ -81,7 +81,7 @@ class Ordergroup < Group
|
||||||
def update_stats!
|
def update_stats!
|
||||||
time = 6.month.ago
|
time = 6.month.ago
|
||||||
jobs = users.collect { |u| u.tasks.done.all(:conditions => ["updated_on > ?", time]).size }.sum
|
jobs = users.collect { |u| u.tasks.done.all(:conditions => ["updated_on > ?", time]).size }.sum
|
||||||
orders_sum = group_orders.collect { |go| go.price if go.order.ends > time }.sum
|
orders_sum = group_orders.select { |go| go.order.ends > time }.collect(&:price).sum
|
||||||
update_attribute(:stats, {:jobs_size => jobs, :orders_sum => orders_sum})
|
update_attribute(:stats, {:jobs_size => jobs, :orders_sum => orders_sum})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue