End of evening commit, changing supplier to JSONAPI

This commit is contained in:
2015-09-08 23:22:13 +02:00
parent 3cb7fd2a6f
commit 9c1945252d
36 changed files with 195 additions and 230 deletions
+7 -16
View File
@@ -1,18 +1,9 @@
class Suppliers::ListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
self.root = :list
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: Suppliers::UserSerializer
class Suppliers::ListSerializer
include Qwaiter::SupplierBaseSerializer
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :closed_at
#def has_active_orders
#object.has_active_orders?
#end
def extended_version
true
end
has_many :orders, serializer: Suppliers::OrderSerializer
has_many :join_requests, serializer: Suppliers::JoinRequestSerializer
has_many :users, serializer: Suppliers::UserSerializer
has_one :table, serializer: Suppliers::TableSerializer
end