FIX: #2664 it should be validates not validate

Thanks @chancancode
This commit is contained in:
Sam 2014-08-18 14:40:54 +10:00
parent e291138cf1
commit baaa3e0f9f
2 changed files with 3 additions and 3 deletions

View File

@ -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"

View File

@ -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}