ip bans: remove unused code.

This commit is contained in:
evazion
2019-08-11 23:38:03 -05:00
parent fa19047220
commit 9729eeb829

View File

@@ -24,22 +24,4 @@ class IpBan < ApplicationRecord
q.apply_default_order(params)
end
def self.query(user_ids)
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")
return {
"comments" => comments,
"notes" => notes,
# "pools" => pools,
"wiki_pages" => wiki_pages
}
end
def self.count_by_ip_addr(table, user_ids, user_id_field = "user_id", ip_addr_field = "ip_addr")
select_all_sql("SELECT #{ip_addr_field}, count(*) FROM #{table} WHERE #{user_id_field} IN (?) GROUP BY #{ip_addr_field} ORDER BY count(*) DESC", user_ids).to_hash
end
end