proper i18n of last ordergroup order (thanks @JuliusR)
This commit is contained in:
parent
d67a0083f1
commit
46ab4dcc01
3 changed files with 8 additions and 2 deletions
|
|
@ -26,6 +26,11 @@ class Ordergroup < Group
|
|||
User.natural_order.all.reject { |u| (users.include?(u) || u.ordergroup) }
|
||||
end
|
||||
|
||||
# the most recent order this ordergroup was participating in
|
||||
def last_order
|
||||
orders.order('orders.starts DESC').first
|
||||
end
|
||||
|
||||
def value_of_open_orders(exclude = nil)
|
||||
group_orders.in_open_orders.reject{|go| go == exclude}.collect(&:price).sum
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue