parent
e291138cf1
commit
baaa3e0f9f
|
@ -23,12 +23,12 @@ class Admin::GroupsController < Admin::AdminController
|
|||
def update
|
||||
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
|
||||
# we can only change the alias level on automatic groups
|
||||
group.alias_level = params[:group][:alias_level]
|
||||
else
|
||||
group.usernames = params[:group][:usernames]
|
||||
group.alias_level = params[:group][:alias_level]
|
||||
group.name = params[:group][:name] if params[:group][:name]
|
||||
end
|
||||
group.visible = params[:group][:visible] == "true"
|
||||
|
|
|
@ -34,7 +34,7 @@ class Group < ActiveRecord::Base
|
|||
: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)
|
||||
user_ids = group_users.map {|gu| gu.user_id}
|
||||
|
|
Loading…
Reference in New Issue