This commit is contained in:
2026-05-04 15:36:13 +09:00
parent a9dce231a4
commit 7ab877d6bd
3 changed files with 22 additions and 5 deletions
+2 -1
View File
@@ -5,5 +5,6 @@ class IpAddress < ApplicationRecord
has_many :users, through: :user_ips
def banned? = banned_at.present?
def ban! = update!(banned_at: Time.current)
def ban! = banned? or update!(banned_at: Time.current)
def unban! = update!(banned_at: nil)
end
+2 -1
View File
@@ -22,5 +22,6 @@ class User < ApplicationRecord
def gte_member? = member? || admin?
def banned? = banned_at.present?
def ban! = update!(banned_at: Time.current)
def ban! = banned? or update!(banned_at: Time.current)
def unban! = update!(banned_at: nil)
end