Save progress

This commit is contained in:
2014-03-30 15:55:22 +02:00
parent e179f6e582
commit 013a41b9f6
71 changed files with 1699 additions and 107 deletions
@@ -0,0 +1,3 @@
class JoinRequestSerializer < Qwaiter::Serializer
attributes :user_id, :user_facebook_id, :list_id
end
+1 -1
View File
@@ -1,7 +1,7 @@
class ListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
#embed :ids
attributes :state, :needs_help, :needs_payment, :is_paid, :price, :table_id, :table_number, :section_id, :has_active_orders, :user_ids
attributes :state, :needs_help, :needs_payment, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_id #, :has_active_orders
#def has_active_orders
#object.has_active_orders?
+1 -1
View File
@@ -1,6 +1,6 @@
class OrderSerializer < Qwaiter::Serializer
embed :ids, include: true
attributes :state, :list_id, :section_id #, :price
attributes :state, :list_id, :section_id, :table_id #, :price
# todo, put this logic in Ember
#def product_orders
+1 -1
View File
@@ -1,5 +1,5 @@
# Used for user ember1
class ProductOrderSerializer < Qwaiter::Serializer
embed :ids
attributes :order_id, :product_id, :quantity, :price
attributes :order_id, :product_id, :quantity, :price, :product_name
end
-4
View File
@@ -10,10 +10,6 @@ class TableSerializer < Qwaiter::Serializer
#object.active_list
#end
def occupied
object.active_list_id.present?
end
def list
object.active_list
end
@@ -17,7 +17,9 @@ class UserExtendedListSerializer < Qwaiter::Serializer
object.has_active_orders?
end
has_many :orders
has_many :product_categories
#has_many :product_categories
has_one :table, serializer: UserExtendedTableSerializer
has_many :join_requests
def extended_version
true
@@ -0,0 +1,10 @@
class UserExtendedSupplierSerializer < Qwaiter::Serializer
self.root = :supplier
embed :ids, include: true
attributes :extended_version, :open, :name
has_many :product_categories
def extended_version
true
end
end
@@ -0,0 +1,6 @@
class UserExtendedTableSerializer < Qwaiter::Serializer
self.root = :table
embed :ids, include: true
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :needs_help
has_one :supplier, serializer: UserExtendedSupplierSerializer
end
@@ -0,0 +1,8 @@
class UserExtendedSupplierSerializer < Qwaiter::Serializer
self.root = :supplier
attributes :extended_version, :open, :name
def extended_version
false
end
end
+4
View File
@@ -0,0 +1,4 @@
class UserTableSerializer < Qwaiter::Serializer
self.root = :table
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :needs_help
end