23 lines
439 B
Ruby
23 lines
439 B
Ruby
class TableSerializer < Qwaiter::Serializer
|
|
embed :ids, include: true
|
|
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied #, :alist_id
|
|
|
|
#def list_id
|
|
#object.active_list_id || object.active_list.try(:id)
|
|
#end
|
|
|
|
#def list
|
|
#object.active_list
|
|
#end
|
|
|
|
def occupied
|
|
object.active_list_id.present?
|
|
end
|
|
|
|
def list
|
|
object.active_list
|
|
end
|
|
|
|
has_one :list, key: :active_list_id
|
|
end
|