Add search method to polls
So far the method does not take questions nor answers into account. This way we'll be able to search polls in the SDG Management section.
This commit is contained in:
@@ -5,6 +5,7 @@ class Poll < ApplicationRecord
|
||||
acts_as_paranoid column: :hidden_at
|
||||
include ActsAsParanoidAliases
|
||||
include Notifiable
|
||||
include Searchable
|
||||
include Sluggable
|
||||
include StatsVersionable
|
||||
include Reportable
|
||||
@@ -175,4 +176,20 @@ class Poll < ApplicationRecord
|
||||
def budget_poll?
|
||||
budget.present?
|
||||
end
|
||||
|
||||
def searchable_translations_definitions
|
||||
{
|
||||
name => "A",
|
||||
summary => "C",
|
||||
description => "D"
|
||||
}
|
||||
end
|
||||
|
||||
def searchable_values
|
||||
searchable_globalized_values
|
||||
end
|
||||
|
||||
def self.search(terms)
|
||||
pg_search(terms)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user