mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 01:22:36 +08:00
14 lines
261 B
Ruby
14 lines
261 B
Ruby
class CategorySerializer < BasicCategorySerializer
|
|
|
|
attributes :secure, :groups, :available_groups
|
|
|
|
def groups
|
|
@groups ||= object.groups.order("name").all.map(&:name)
|
|
end
|
|
|
|
def available_groups
|
|
Group.order("name").map(&:name) - groups
|
|
end
|
|
|
|
end
|