discourse/app/serializers/category_serializer.rb

14 lines
279 B
Ruby
Raw Normal View History

class CategorySerializer < BasicCategorySerializer
attributes :secure, :groups, :available_groups, :auto_close_days
def groups
@groups ||= object.groups.order("name").all.map(&:name)
end
def available_groups
Group.order("name").map(&:name) - groups
end
2013-02-06 03:16:51 +08:00
end