Fixed bug in orders index if order.ends.nil?

This commit is contained in:
Benjamin Meichsner 2010-06-19 12:23:18 +02:00
parent db52c6e4ed
commit fbf6a283a0
3 changed files with 8 additions and 3 deletions

View file

@ -94,6 +94,10 @@ class Order < ActiveRecord::Base
state == "closed"
end
def expired?
!ends.nil? && ends < Time.now
end
# search GroupOrder of given Ordergroup
def group_order(ordergroup)
group_orders.first :conditions => { :ordergroup_id => ordergroup.id }