Update topics_controller.rb
This commit is contained in:
parent
350df8a410
commit
f9166119f3
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ class TopicsController < ApplicationController
|
|||
term = params[:term]
|
||||
if term && !term.empty?
|
||||
# !connor term here needs to have .downcase
|
||||
@topics = Topic.where('LOWER("name") like ?', term + '%').order('"name"')
|
||||
@topics = Topic.where('LOWER("name") like ?', term.downcase + '%').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)) }
|
||||
|
|
Loading…
Reference in a new issue