app/models/user.rb
def in_group?(group_or_gid)
    if group_or_gid.is_a?(Group)
      groups.include?(group_or_gid)
    else
      group_gids.include?(group_or_gid)
    end
  end
# Return whether the user is in the group with the given id
Return whether the user is in the group with the given id
Return whether the user is in the group with the given id
def in_group?(group_or_gid)
    if group_or_gid.is_a?(Group)
      groups.include?(group_or_gid)
    else
      group_gids.include?(group_or_gid)
    end
  end
def in_group? ( group_or_gid ) if group_or_gid . is_a? ( Group ) groups . include? ( group_or_gid ) else group_gids . include? ( group_or_gid ) end end
Return whether the user is in the group with the given id
Return whether the user is in the group with the given id
group_or_gid