User app updates
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#class ListExtendedSerializer
|
||||
#render json: {
|
||||
#list: list.serialized_with_status_join_requests_and_supplier_counters.merge(order_ids: list.orders.map(&:id)),
|
||||
#}
|
||||
#.merge(ActiveModel::ArraySerializer.new(list.supplier.product_categories, each_serializer: ProductCategorySerializer, root: :product_categories).as_json)
|
||||
#.merge(ActiveModel::ArraySerializer.new(list.orders, each_serializer: OrderSerializer, root: :orders).as_json)
|
||||
#end
|
||||
class UserExtendedListSerializer < Qwaiter::Serializer
|
||||
# user ids for facebook pictures
|
||||
self.root = :list
|
||||
embed :ids, include: true
|
||||
attributes :extended_version, :state, :needs_help, :needs_payment, :is_paid, :price,
|
||||
:table_id, :table_number, :section_id, :user_ids,
|
||||
:supplier_orders_in_process_count, :supplier_orders_placed_count
|
||||
|
||||
def has_active_orders
|
||||
object.has_active_orders?
|
||||
end
|
||||
has_many :orders
|
||||
has_many :product_categories
|
||||
|
||||
def extended_version
|
||||
true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user