FEATURE: add support for group visibility level

There are 4 visibility levels

- public (default)
- members only
- staff
- owners

Note, admins and group owners ALWAYS have visibility to groups

Migration treated old "non public" as "members only"
This commit is contained in:
Sam
2017-07-03 15:26:57 -04:00
parent c79418d334
commit 845170bd6b
17 changed files with 248 additions and 117 deletions
@@ -0,0 +1,12 @@
class AddVisibilityLevelToGroups < ActiveRecord::Migration
def change
add_column :groups, :visibility_level, :integer, default: 0, null: false
execute <<~SQL
UPDATE groups
SET visibility_level = 1
WHERE NOT visible
SQL
remove_column :groups, :visible
end
end