Track the ip address where user was registered

This commit is contained in:
Neil Lalonde
2014-04-29 14:37:56 -04:00
parent 4371374ba6
commit f61f29439e
7 changed files with 36 additions and 7 deletions
+5 -3
View File
@@ -40,9 +40,11 @@ class UserDestroyer
b = ScreenedEmail.block(u.email, ip_address: u.ip_address)
b.record_match! if b
end
if opts[:block_ip]
b = ScreenedIpAddress.watch(u.ip_address)
b.record_match! if b
if opts[:block_ip] && u.ip_address
b.record_match! if b = ScreenedIpAddress.watch(u.ip_address)
if u.registration_ip_address && u.ip_address != u.registration_ip_address
b.record_match! if b = ScreenedIpAddress.watch(u.registration_ip_address)
end
end
Post.with_deleted.where(user_id: user.id).update_all("user_id = NULL")