Skip to content
Snippets Groups Projects
Commit ac296a0c authored by Douglas AC's avatar Douglas AC
Browse files

incrementing "times_blocked" counter every time a user is blocked or banished.

parent fe006d2e
No related branches found
No related tags found
No related merge requests found
......@@ -336,10 +336,12 @@ class User < ApplicationRecord
if option == "blocked"
self.suspended_at = Time.current
self.reactivated_at = self.suspended_at + 7.day
self.increment(:times_blocked, 1)
self.blocked!
elsif option == "banished"
self.suspended_at = Time.current
self.reactivated_at = nil
self.increment(:times_blocked, 1)
self.banished!
elsif
raise ArgumentError.new(I18n.t("error.wrong_arguments", param: "option"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment