FEATURE: auto-close topics based on last post

This commit is contained in:
Régis Hanol
2014-10-10 18:21:44 +02:00
parent ac72b0bcf6
commit 5754e8dd0f
28 changed files with 242 additions and 146 deletions

View File

@@ -3,6 +3,7 @@ class CategorySerializer < BasicCategorySerializer
attributes :read_restricted,
:available_groups,
:auto_close_hours,
:auto_close_based_on_last_post,
:group_permissions,
:position,
:email_in,
@@ -20,7 +21,7 @@ class CategorySerializer < BasicCategorySerializer
}
end
if perms.length == 0 && !object.read_restricted
perms << {permission_type: CategoryGroup.permission_types[:full], group_name: :everyone}
perms << { permission_type: CategoryGroup.permission_types[:full], group_name: :everyone }
end
perms
end
@@ -30,7 +31,6 @@ class CategorySerializer < BasicCategorySerializer
Group.order(:name).pluck(:name) - group_permissions.map{|g| g[:group_name]}
end
def can_delete
true
end