Commit 380171e5 authored by pierre.tremouilhac's avatar pierre.tremouilhac
Browse files

Merge branch 'sample-type-search' into 'development'

Add search_by_substring for Sample model

See merge request ComPlat/chemotion_ELN!465
parents abaeab71 d6a3f421
......@@ -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
Supports Markdown
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