Commit d6a3f421 authored by an.nguyen's avatar an.nguyen
Browse files

Add search_by_substring for Sample model

parent abaeab71
......@@ -32,6 +32,12 @@ class Sample < ActiveRecord::Base
molecule: :cano_smiles
}
pg_search_scope :search_by_substring, against: %i[
name short_label external_label
], associated_against: {
molecule: %i[sum_formular iupac_name inchistring cano_smiles]
}, using: { trigram: { threshold: 0.0001 } }
pg_search_scope :search_by_sample_name, against: :name
pg_search_scope :search_by_sample_short_label, against: :short_label
pg_search_scope :search_by_sample_external_label, against: :external_label
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment