Remove IpAddress model.

This commit is contained in:
evazion
2022-09-17 23:29:57 -05:00
parent 075199cd1e
commit 553d35178c
8 changed files with 12 additions and 68 deletions

View File

@@ -28,10 +28,10 @@
<tr>
<th>Proxy?</th>
<td><%= ip_address.ip_addr.is_proxy? ? "Yes" : "No" %></td>
<td><%= ip_address.is_proxy? ? "Yes" : "No" %></td>
</tr>
<% if ip_address.ip_addr.is_tor? %>
<% if ip_address.is_tor? %>
<tr>
<th>Tor?</th>
<td>Yes</td>
@@ -41,8 +41,8 @@
<tr>
<th>IP Banned?</th>
<td>
<% if IpBan.ip_matches(ip_address.ip_addr.to_s).exists? %>
Yes (<%= link_to "info", ip_bans_path(search: { ip_addr: ip_address.ip_addr.to_s }) %>)
<% if IpBan.ip_matches(ip_address.to_s).exists? %>
Yes (<%= link_to "info", ip_bans_path(search: { ip_addr: ip_address.to_s }) %>)
<% else %>
No
<% end %>
@@ -78,7 +78,7 @@
<th>Details</th>
<td>
<details>
<pre><%= JSON.pretty_generate(ip_address.lookup.response) %></pre>
<pre><%= JSON.pretty_generate(ip_address.ip_lookup.response) %></pre>
</details>
</td>
</tr>

View File

@@ -2,7 +2,7 @@
<div id="c-ip-addresses">
<div id="a-show">
<h1>IP Address: <%= @ip_address.ip_addr %></h1>
<h1>IP Address: <%= @ip_address %></h1>
<%= render "info", ip_address: @ip_address, ip_info: @ip_info %>
</div>

View File

@@ -18,7 +18,7 @@
</tr>
<% end %>
<% if policy(IpAddress).show? %>
<% if policy(:ip_address).show? %>
<tr>
<th>Last IP</th>
<td>

View File

@@ -15,7 +15,7 @@
<% t.column "Name", td: { class: "col-expand" } do |user| %>
<%= link_to_user user %>
<% end %>
<% if policy(IpAddress).show? %>
<% if policy(:ip_address).show? %>
<% t.column "IP" do |user| %>
<% if user.last_ip_addr.present? %>
<%= link_to user.last_ip_addr, ip_address_path(user.last_ip_addr) %>

View File

@@ -34,7 +34,7 @@
<div class="user-tooltip-header-bottom">
<%= time_tag @user.created_at.to_date.iso8601, @user.created_at, class: "user-tooltip-created-at" %>
<% if @user.last_ip_addr.present? && policy(IpAddress).show? %>
<% if @user.last_ip_addr.present? && policy(:ip_address).show? %>
· <%= link_to_ip @user.last_ip_addr, shorten: true, class: "link-plain" %>
<% end %>