From c0a7c88b8d8d64cc6f781ab538827d4af35f7f75 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Tue, 17 Mar 2020 04:31:59 +0200 Subject: [PATCH] Fix model + temp fix for view --- app/models/ban.rb | 4 ++-- app/views/users/index.html.erb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/ban.rb b/app/models/ban.rb index bb5e5ec..bf5c406 100755 --- a/app/models/ban.rb +++ b/app/models/ban.rb @@ -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 diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 9ce4e05..c73b97c 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,6 +1,7 @@

Listing Users

<%= User.lately.count %> players have signed in within the past 30 days.

-<%= link_to 'Show them', params.merge(filter: 'lately'), class: 'button' %>


+<% # FIXME: check this %> +<%= link_to 'Show them', params.to_enum.to_h.merge(filter: 'lately'), class: 'button' %>


Search for users by name or Steam ID: