2013-05-10 02:47:47 -04:00
|
|
|
class CategorySerializer < BasicCategorySerializer
|
|
|
|
|
2013-05-15 15:19:41 -04:00
|
|
|
attributes :secure, :groups, :available_groups, :auto_close_days
|
2013-05-10 02:47:47 -04:00
|
|
|
|
|
|
|
def groups
|
|
|
|
@groups ||= object.groups.order("name").all.map(&:name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def available_groups
|
|
|
|
Group.order("name").map(&:name) - groups
|
|
|
|
end
|
2013-02-21 18:09:56 -05:00
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|