End of day commit

This commit is contained in:
2015-02-18 22:36:47 +01:00
parent 82670f271b
commit c1858455e9
68 changed files with 633 additions and 145 deletions
@@ -1,6 +1,5 @@
class Suppliers::EmployeeSerializer < Qwaiter::Serializer
self.root = :employee
embed :ids, include: true
attributes :supplier_id, :name, :email
has_many :orders
attributes :name, :email
end
@@ -0,0 +1,6 @@
class Suppliers::ExtendedSectionSerializer < Qwaiter::Serializer
root 'section'
embed :ids, include: true
attributes :title, :path, :width, :height
has_many :tables, serializer: Suppliers::ExtendedTableSerializer
end
@@ -0,0 +1,15 @@
class Suppliers::ExtendedTableSerializer < Qwaiter::Serializer
root 'table'
embed :ids, include: true
attributes :number, :width, :height, :position_x, :position_y, :section_id#, :active_list_id
#def list_id
#object.active_list_id || object.active_list.try(:id)
#end
#def list
#object.active_list
#end
#has_one :list, key: :active_list_id, serializer: SupplierExtendedListSerializer
end
@@ -0,0 +1,12 @@
class Suppliers::SupplierSerializer < Qwaiter::Serializer
self.root = :supplier
embed :ids, include: true
attributes :extended_version, :open, :name, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country,
:facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count
def extended_version
true
end
has_many :sections, serializer: Suppliers::ExtendedSectionSerializer
has_many :product_categories
end