Show last activity of ordergroups

This commit is contained in:
Patrick Gansterer 2016-02-18 00:00:55 +01:00 committed by wvengen
parent 4cacb740d1
commit 8b8693df5a
4 changed files with 11 additions and 1 deletions

View file

@ -26,6 +26,13 @@ class Ordergroup < Group
User.natural_order.all.reject { |u| (users.include?(u) || u.ordergroup) }
end
def last_user_activity
last_active_user = users.order('users.last_activity DESC').first
if last_active_user
last_active_user.last_activity
end
end
# the most recent order this ordergroup was participating in
def last_order
orders.order('orders.starts DESC').first