Add search method to legislation processes

This way we'll be able to search processes in the SDG Management
section.
This commit is contained in:
Javi Martín
2020-12-16 14:36:23 +01:00
parent 852014e478
commit 948a8b2904
6 changed files with 68 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ class Legislation::Process < ApplicationRecord
include Imageable
include Documentable
include SDG::Relatable
include Searchable
acts_as_paranoid column: :hidden_at
acts_as_taggable_on :customs
@@ -123,6 +124,22 @@ class Legislation::Process < ApplicationRecord
end
end
def searchable_translations_definitions
{
title => "A",
summary => "C",
description => "D"
}
end
def searchable_values
searchable_globalized_values
end
def self.search(terms)
pg_search(terms)
end
private
def valid_date_ranges