diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 384839e0..0f0b1252 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -29,7 +29,7 @@ class ManagementsController < ApplicationController end def user_agents - @user_agents = UserAgent.joins("JOIN users u ON u.login = user_agents.key").where("user_agents.key is not null and is_delete = 0 and u.login is not null").order("created_at desc") + @user_agents = UserAgent.where("user_agents.key is not null and is_delete = 0").order("created_at desc") @agents_count = @user_agents.count limit = 20 @agents_pages = Paginator.new @agents_count, limit, params['page'] || 1 diff --git a/app/views/managements/_user_agent_list.html.erb b/app/views/managements/_user_agent_list.html.erb index 286d0f6a..1876d3ef 100644 --- a/app/views/managements/_user_agent_list.html.erb +++ b/app/views/managements/_user_agent_list.html.erb @@ -13,6 +13,7 @@
<% @user_agents.each do |ua| %> <% user = User.find_by_login(ua.key) %> + <% next if user.nil? %> <% user_extension = user&.user_extensions %> <% school = user_extension&.school %>