This commit is contained in:
Devin Howard 2017-01-23 17:39:21 -05:00
parent 77d39e445a
commit bb2122d854
3 changed files with 9 additions and 6 deletions

View file

@ -19,7 +19,8 @@ class MainController < ApplicationController
end
# GET /request
def requestinvite; end
def requestinvite
end
private

View file

@ -11,7 +11,9 @@ class TopicsController < ApplicationController
def autocomplete_topic
term = params[:term]
if term && !term.empty?
topics = policy_scope(Topic).where('LOWER("name") like ?', term.downcase + '%').order('"name"')
topics = policy_scope(Topic)
.where('LOWER("name") like ?', term.downcase + '%')
.order('"name"')
map_topics = topics.select { |t| t&.metacode&.name == 'Metamap' }
# prioritize topics which point to maps, over maps
exclude = map_topics.length.positive? ? map_topics.map(&:name) : ['']