moves search by author name to full text searches

This commit is contained in:
rgarcia
2016-01-16 22:10:17 +01:00
parent 44769d96f4
commit 82f9a656ad
7 changed files with 24 additions and 69 deletions

View File

@@ -2,7 +2,6 @@ module Filterable
extend ActiveSupport::Concern
included do
scope :by_author, -> (username) { where(users: { username: username }).joins(:author) }
scope :by_official_level, -> (official_level) { where(users: { official_level: official_level }).joins(:author) }
scope :by_date_range, -> (date_range) { where(created_at: date_range) }
end
@@ -21,7 +20,7 @@ module Filterable
def allowed_filter?(filter, value)
return if value.blank?
['author', 'official_level', 'date_range'].include?(filter)
['official_level', 'date_range'].include?(filter)
end
end

View File

@@ -68,6 +68,7 @@ class Proposal < ActiveRecord::Base
description => 'D'
}
tag_list.each{ |tag| values[tag] = 'D' }
values[author.username] = 'D'
values
end