working ember... again

This commit is contained in:
2013-10-07 23:00:01 +02:00
parent a8c01d264e
commit 2f41560591
46 changed files with 274 additions and 114 deletions
+5 -1
View File
@@ -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 -1
View File
@@ -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
+16 -1
View File
@@ -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