User app refactor

This commit is contained in:
2014-08-28 14:53:24 +02:00
parent 0dcbc4151c
commit 40d06156fa
13 changed files with 26 additions and 20 deletions
@@ -18,7 +18,7 @@ class UserExtendedListSerializer < Qwaiter::Serializer
end
has_many :orders
#has_many :product_categories
has_one :table, serializer: UserExtendedTableSerializer
has_one :table, serializer: UserExtendedTableSerializer # this one add a lot of stuff
has_many :join_requests
has_many :users, serializer: UserUserSerializer
#has_one :supplier # added by other resource
+3 -2
View File
@@ -1,6 +1,6 @@
class UserListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
embed :ids
embed :ids, include: true
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_name, :closed_at, :supplier_id
#def has_active_orders
@@ -9,6 +9,7 @@ class UserListSerializer < Qwaiter::Serializer
def supplier_name
object.supplier.name
end
has_many :users
has_many :users, serializer: UserUserSerializer
has_many :orders
has_one :supplier, serializer: UserSupplierSerializer
end