Flow fixes
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class SupplierExtendedListSerializer < Qwaiter::Serializer
|
||||
# user ids for facebook pictures
|
||||
embed :ids, include: true
|
||||
root 'list'
|
||||
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :supplier_id, :closed_at #, :has_active_orders
|
||||
|
||||
#def has_active_orders
|
||||
#object.has_active_orders?
|
||||
#end
|
||||
has_many :users, serializer: SupplierUserSerializer
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class SupplierExtendedSectionSerializer < Qwaiter::Serializer
|
||||
root 'section'
|
||||
embed :ids, include: true
|
||||
attributes :title, :path, :width, :height
|
||||
has_many :tables, serializer: SupplierExtendedTableSerializer
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
class SupplierExtendedTableSerializer < Qwaiter::Serializer
|
||||
root 'table'
|
||||
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 list
|
||||
object.active_list
|
||||
end
|
||||
|
||||
has_one :list, key: :active_list_id, serializer: SupplierExtendedListSerializer
|
||||
end
|
||||
Reference in New Issue
Block a user