Show last activity of ordergroups
This commit is contained in:
parent
4cacb740d1
commit
8b8693df5a
4 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue