Fix #4038: Attempting to create an IP-ban bans the creator.

* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
This commit is contained in:
evazion
2019-01-09 15:15:57 -06:00
parent fa6d86e882
commit 80f43f9a7c
7 changed files with 26 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ class IpBan < ApplicationRecord
end
def self.query(user_ids)
comments = count_by_ip_addr("comments", user_ids, "creator_id", "ip_addr")
comments = count_by_ip_addr("comments", user_ids, "creator_id", "creator_ip_addr")
notes = count_by_ip_addr("note_versions", user_ids, "updater_id", "updater_ip_addr")
# pools = count_by_ip_addr("pool_versions", user_ids, "updater_id", "updater_ip_addr")
wiki_pages = count_by_ip_addr("wiki_page_versions", user_ids, "updater_id", "updater_ip_addr")