working ember... again
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
class ListSerializer < Qwaiter::Serializer
|
||||
embed :ids
|
||||
attributes :state, :needs_help, :needs_payment, :is_paid, :price, :table_id, :table_number, :section_id
|
||||
attributes :state, :needs_help, :needs_payment, :is_paid, :price, :table_id, :table_number, :section_id, :has_active_orders
|
||||
|
||||
def has_active_orders
|
||||
object.has_active_orders?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class SectionSerializer < Qwaiter::Serializer
|
||||
embed :ids, include: true
|
||||
attributes *%i[title path width height]
|
||||
attributes :title, :path, :width, :height
|
||||
has_many :tables
|
||||
end
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
class TableSerializer < Qwaiter::Serializer
|
||||
attributes(*%i[number width height position_x position_y section_id occupied active_list_id])
|
||||
embed :ids, include: true
|
||||
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied #, :alist_id
|
||||
|
||||
#def list_id
|
||||
#object.active_list_id || object.active_list.try(:id)
|
||||
#end
|
||||
|
||||
#def list
|
||||
#object.active_list
|
||||
#end
|
||||
|
||||
def occupied
|
||||
object.active_list_id.present?
|
||||
end
|
||||
|
||||
def list
|
||||
object.active_list
|
||||
end
|
||||
|
||||
has_one :list, key: :active_list_id
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user