include dmail ip addrs in search

This commit is contained in:
r888888888
2014-02-21 14:15:37 -08:00
parent 10516c9834
commit 3ba7daebd1
3 changed files with 6 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ module Moderator
add_row(sums, "select updater_id as k, count(*) from note_versions where updater_ip_addr in (?) group by k", ip_addrs)
add_row(sums, "select updater_id as k, count(*) from pool_versions where updater_ip_addr in (?) group by k", ip_addrs)
add_row(sums, "select updater_id as k, count(*) from wiki_page_versions where updater_ip_addr in (?) group by k", ip_addrs)
add_row(sums, "select from_id as k, count(*) from dmails where creator_ip_addr in (?) group by k", ip_addrs)
sums
end
@@ -49,6 +50,7 @@ module Moderator
add_row(sums, "select updater_ip_addr as k, count(*) from note_versions where updater_id in (?) group by k", user_ids)
add_row(sums, "select updater_ip_addr as k, count(*) from pool_versions where updater_id in (?) group by k", user_ids)
add_row(sums, "select updater_ip_addr as k, count(*) from wiki_page_versions where updater_id in (?) group by k", user_ids)
add_row(sums, "select creator_ip_addr as k, count(*) from dmails where from_id in (?) group by k", user_ids)
sums
end

View File

@@ -8,6 +8,9 @@
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to %></li>
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
<% if CurrentUser.user.is_moderator? %>
<li><strong>Sender IP</strong>: <%= @dmail.creator_ip_addr %></li>
<% end %>
</ul>
<h3>Body</h3>

View File

@@ -1,5 +1,6 @@
class AddIpAddrToDmails < ActiveRecord::Migration
def change
add_column :dmails, :creator_ip_addr, :inet, :null => false, :default => "127.0.0.1"
add_index :dmails, :creator_ip_addr
end
end