20 lines
655 B
Ruby
20 lines
655 B
Ruby
class SupplierListSerializer < Qwaiter::Serializer
|
|
# user ids for facebook pictures
|
|
self.root = :list
|
|
embed :ids, include: true
|
|
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price,
|
|
:table_id, :table_number, :section_id, :user_ids, :supplier_id, :closed_at
|
|
has_many :orders
|
|
#has_many :product_categories
|
|
#has_one :table, serializer: SupplierTableSerializer # tables are part of the sectoins load
|
|
has_many :join_requests
|
|
has_many :users, serializer: SupplierUserSerializer
|
|
|
|
#def has_active_orders
|
|
#object.has_active_orders?
|
|
#end
|
|
def extended_version
|
|
true
|
|
end
|
|
end
|