moves search by author name to full text searches
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -68,6 +68,7 @@ class Proposal < ActiveRecord::Base
|
||||
description => 'D'
|
||||
}
|
||||
tag_list.each{ |tag| values[tag] = 'D' }
|
||||
values[author.username] = 'D'
|
||||
values
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user