mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add group settngs to allow users to leave a group freely.
https://meta.discourse.org/t/split-join-leave-freely-setting-on-groups/65565
This commit is contained in:
17
db/migrate/20170728012754_split_public_in_groups.rb
Normal file
17
db/migrate/20170728012754_split_public_in_groups.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class SplitPublicInGroups < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :groups, :public_exit, :boolean, default: false, null: false
|
||||
add_column :groups, :public_admission, :boolean, default: false, null: false
|
||||
|
||||
ActiveRecord::Base.exec_sql <<~SQL
|
||||
UPDATE groups
|
||||
SET public_exit = true, public_admission = true
|
||||
WHERE public = true
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :groups, :public_exit
|
||||
remove_column :groups, :public_admission
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user