Fixed bad syntax (from already dropped meta_where gem).
Thanks to wvengen, closed #91
This commit is contained in:
parent
82178161fa
commit
6685012a3e
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ class Workgroup < Group
|
|||
# add validation check on update
|
||||
# Return an error if this is the last group with admin role and role_admin should set to false
|
||||
def last_admin_on_earth
|
||||
if !role_admin && Workgroup.where(:role_admin => true, :id.ne => id).empty?
|
||||
if !role_admin && !Workgroup.where('role_admin = ? AND id != ?', true, id).exists?
|
||||
errors.add(:role_admin, "Der letzten Gruppe mit Admin-Rechten darf die Admin-Rolle nicht entzogen werden")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue