uses ActsAsTaggableOn.named rather than SQL to check for an existing Tag

This commit is contained in:
David Gil
2015-09-17 14:25:57 +02:00
parent e2e7f8c2f2
commit 6b5eafd06c

View File

@@ -85,7 +85,7 @@ class DebatesController < ApplicationController
def parse_tag_filter
if params[:tag].present?
@tag_filter = params[:tag] if ActsAsTaggableOn::Tag.where("LOWER(tags.name) = ?", params[:tag].downcase).exists?
@tag_filter = params[:tag] if ActsAsTaggableOn::Tag.named(params[:tag]).exists?
end
end