remove-acts-as-taggable #38
@ -1,5 +1,6 @@
|
|||||||
class GroupsController < ApplicationController
|
class GroupsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
render jsonapi: Group.where(parent_id: nil), include: [children: [children: [:children]]]
|
roots = Group.where(parent_id: nil)
|
||||||
|
render jsonapi: roots, include: [children: [children: [:children]]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,4 +4,8 @@ class SerializableGroup < JSONAPI::Serializable::Resource
|
|||||||
attributes :name, :icon
|
attributes :name, :icon
|
||||||
|
|
||||||
has_many :children
|
has_many :children
|
||||||
|
|
||||||
|
attribute :guest_count do
|
||||||
|
@object.guests.count
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user