# Bulk suspend users based on criteria

**URL:** <https://meta.discourse.org/t/bulk-suspend-users-based-on-criteria/76804>\
**Category:** Product Support\
**Created:** [27.Декабрь.2017 08:06:27 UTC](https://meta.discourse.org/t/bulk-suspend-users-based-on-criteria/76804 "2017-12-27T08:06:27Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [01.Январь.2018 00:27:14 UTC](https://meta.discourse.org/t/bulk-suspend-users-based-on-criteria/76804/9 "2018-01-01T00:27:14Z")

</div>

I’ve realized that using `last_seen_at` for the filter is going to suspend too many current members to fix manually, so I’d like tweak this slightly to suspend all users who are **not** members of a group.

My attempt with

```plaintext
users = User.where.not(group_id: 41, id: 1..Float::INFINITY, admin: false)

```

failed because

`ERROR: column users.group_id does not exist`

What should I use instead?

---

_[View the full topic](https://meta.discourse.org/t/bulk-suspend-users-based-on-criteria/76804)._
