Fix model + temp fix for view

This commit is contained in:
Ari Timonen 2020-03-17 04:31:59 +02:00
parent a66cb599a1
commit c0a7c88b8d
2 changed files with 4 additions and 3 deletions

View file

@ -80,8 +80,8 @@ class Ban < ActiveRecord::Base
if user_name
self.user = User.find_by_username(user_name)
else
self.user = User.first(conditions: { steamid: steamid })
self.server = Server.first(conditions: ["CONCAT(ip, ':', port) = ?", addr])
self.user = User.where(steamid: steamid).first
self.server = Server.where("CONCAT(ip, ':', port) = ?", addr).first
end
end

View file

@ -1,6 +1,7 @@
<h1 class="title">Listing Users</h1>
<p><%= User.lately.count %> players have signed in within the past 30 days.</p>
<%= link_to 'Show them', params.merge(filter: 'lately'), class: 'button' %><br><br><br>
<% # FIXME: check this %>
<%= link_to 'Show them', params.to_enum.to_h.merge(filter: 'lately'), class: 'button' %><br><br><br>
<p>Search for users by name or Steam ID:</p>