diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 61b49ba3..931f869d 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -71,12 +71,8 @@ class MainController < ApplicationController if !user @topics = Topic.where('LOWER("name") like ?', search).where('metacode_id = ?', filterByMetacode.id).order('"name"') - #read this next line as 'delete a topic if its private and you're either 1. logged out or 2. logged in but not the topic creator - @topics.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) } elsif user @topics = Topic.where('LOWER("name") like ?', search).where('metacode_id = ? AND user_id = ?', filterByMetacode.id, user).order('"name"') - #read this next line as 'delete a topic if its private and you're either 1. logged out or 2. logged in but not the topic creator - @topics.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) } end end elsif desc