class Users::ListSerializer < Qwaiter::UserBaseSerializer # user ids for facebook pictures #self.root = :list attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :closed_at has_many :users, serializer: Users::UserSerializer has_many(:orders, serializer: OrderSerializer){} has_one :supplier, serializer: Users::SupplierSerializer has_one :table def include_orders? @_include_linkages.any?{|link| link =~ /orders/} end related_link_for :orders, :table #belongs_to :table end