Activate Ember2 for suppliers

This commit is contained in:
2015-08-27 19:52:47 +02:00
parent e71580f349
commit eca4a23c64
79 changed files with 467 additions and 414 deletions
@@ -1,10 +0,0 @@
class SupplierExtendedListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
root 'list'
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :section_id, :supplier_id, :closed_at #, :has_active_orders
#def has_active_orders
#object.has_active_orders?
#end
has_many :users, serializer: SupplierUserSerializer
end
@@ -1,4 +0,0 @@
class SupplierSectionSerializer < Qwaiter::Serializer
root 'section'
attributes :title, :path, :width, :height
end
@@ -1,8 +0,0 @@
class SupplierUserSerializer < Qwaiter::Serializer
self.root = :user
attributes :email, :provider, :uid, :name, :avatar
def name
object.supplier_name
end
end
@@ -1,6 +1,6 @@
class Suppliers::EmployeeShiftSerializer < Qwaiter::Serializer
self.root = :employee_shift
#embed :ids, include: true
attributes :start_from, :end_on, :employee_id
has_one :supplier
attributes :start_from, :end_on, :employee_id, :supplier_id
#has_one :supplier
end
@@ -1,5 +1,5 @@
class Suppliers::ExtendedTableSerializer < Qwaiter::Serializer
root 'table'
root :table
attributes :number, :width, :height, :position_x, :position_y, :section_id#, :active_list_id
#def list_id
@@ -1,4 +1,4 @@
class SupplierListSerializer < Qwaiter::Serializer
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,
@@ -7,7 +7,7 @@ class SupplierListSerializer < Qwaiter::Serializer
#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
has_many :users, serializer: Suppliers::UserSerializer
#def has_active_orders
#object.has_active_orders?
@@ -0,0 +1,4 @@
class Suppliers::SectionSerializer < Qwaiter::Serializer
root :section
attributes :title, :path, :width, :height
end
@@ -0,0 +1,12 @@
class Suppliers::UserSerializer < Qwaiter::Serializer
self.root = :user
attributes :email, :provider, :uid, :name, :avatar, :list_id
def list_id
object.active_list_id
end
def name
object.supplier_name
end
end