Fixed bug in orders index if order.ends.nil?
This commit is contained in:
parent
db52c6e4ed
commit
fbf6a283a0
3 changed files with 8 additions and 3 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue