From 258be6f9179397a33abc33ec4e23300efa73deb3 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 3 Aug 2021 01:00:11 -0700 Subject: [PATCH] -1 query --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 547bdd67..d233c16b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -27,7 +27,7 @@ class ApplicationController < ActionController::Base session.delete(:universe_id) elsif params[:universe].is_a?(String) && params[:universe].to_i.to_s == params[:universe] found_universe = Universe.find_by(id: params[:universe]) - found_universe = nil unless current_user.universes.include?(found_universe) || current_user.contributable_universes.include?(found_universe) + found_universe = nil unless found_universe.user_id == current_user.id || current_user.contributable_universes.include?(found_universe) session[:universe_id] = found_universe.id if found_universe end end