mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 03:15:41 +08:00
parent
e291138cf1
commit
baaa3e0f9f
@ -23,12 +23,12 @@ class Admin::GroupsController < Admin::AdminController
|
|||||||
def update
|
def update
|
||||||
group = Group.find(params[:id].to_i)
|
group = Group.find(params[:id].to_i)
|
||||||
|
|
||||||
|
group.alias_level = params[:group][:alias_level].to_i if params[:group][:alias_level].present?
|
||||||
|
|
||||||
if group.automatic
|
if group.automatic
|
||||||
# we can only change the alias level on automatic groups
|
# we can only change the alias level on automatic groups
|
||||||
group.alias_level = params[:group][:alias_level]
|
|
||||||
else
|
else
|
||||||
group.usernames = params[:group][:usernames]
|
group.usernames = params[:group][:usernames]
|
||||||
group.alias_level = params[:group][:alias_level]
|
|
||||||
group.name = params[:group][:name] if params[:group][:name]
|
group.name = params[:group][:name] if params[:group][:name]
|
||||||
end
|
end
|
||||||
group.visible = params[:group][:visible] == "true"
|
group.visible = params[:group][:visible] == "true"
|
||||||
|
@ -34,7 +34,7 @@ class Group < ActiveRecord::Base
|
|||||||
:everyone => 99
|
:everyone => 99
|
||||||
}
|
}
|
||||||
|
|
||||||
validate :alias_level, inclusion: { in: ALIAS_LEVELS.values}
|
validates :alias_level, inclusion: { in: ALIAS_LEVELS.values}
|
||||||
|
|
||||||
def posts_for(guardian, before_post_id=nil)
|
def posts_for(guardian, before_post_id=nil)
|
||||||
user_ids = group_users.map {|gu| gu.user_id}
|
user_ids = group_users.map {|gu| gu.user_id}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user