Commit 55617479 authored by Shem Gyll's avatar Shem Gyll Committed by Achilleas Pipinellis

Change block users for inactivity to deactivate users instead: documentation

parent 5559a68e
......@@ -492,10 +492,22 @@ users.each do |user|
end
```
### Deactivate Users that have no recent activity
```ruby
days_inactive = 90
inactive_users = User.active.where("last_activity_on <= ?", days_inactive.days.ago)
inactive_users.each do |user|
puts "user '#{user.username}': #{user.last_activity_on}"
user.deactivate!
end
```
### Block Users that have no recent activity
```ruby
days_inactive = 60
days_inactive = 90
inactive_users = User.active.where("last_activity_on <= ?", days_inactive.days.ago)
inactive_users.each do |user|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment