edit order user-interface update

also closes foodcoops#145
This commit is contained in:
wvengen 2014-02-20 12:37:51 +01:00
parent 63e2ec9d49
commit 8c0df3b4e8
12 changed files with 62 additions and 15 deletions

View file

@ -1,7 +1,6 @@
# encoding: utf-8
#
class Order < ActiveRecord::Base
attr_accessor :ignore_warnings
# Associations
@ -30,9 +29,12 @@ class Order < ActiveRecord::Base
scope :finished_not_closed, -> { where(state: 'finished').order('ends DESC') }
scope :closed, -> { where(state: 'closed').order('ends DESC') }
scope :stockit, -> { where(supplier_id: 0).order('ends DESC') }
scope :recent, -> { order('starts DESC').limit(10) }
# Allow separate inputs for date and time
include DateTimeAttribute
date_time_attribute :starts, :ends
def stockit?
supplier_id == 0
end