app/models/page.rb
# NOTE: we DON'T store :name becuse it will necessarily already be in one of
# the other fields.
we DON'T store :name becuse it will necessarily already be in one of
the other fields.
we DON ' T store : name becuse it will necessarily already be in one of the other fields .
def search_data
    verns = vernacular_strings.uniq
    pref_verns = preferred_vernacular_strings
    {
      id: id,
      scientific_name: scientific_name_string,
      preferred_scientific_names: preferred_scientific_strings,
      synonyms: synonyms,
      preferred_vernacular_strings: pref_verns,
      dh_scientific_names: dh_scientific_names,
      vernacular_strings: verns,
    }.merge(autocomplete_names_per_locale)
  end
def search_data verns = vernacular_strings . uniq pref_verns = preferred_vernacular_strings { id : id , scientific_name : scientific_name_string , preferred_scientific_names : preferred_scientific_strings , synonyms : synonyms , preferred_vernacular_strings : pref_verns , dh_scientific_names : dh_scientific_names , vernacular_strings : verns , } . merge ( autocomplete_names_per_locale ) end
NOTE: we DON'T store :name becuse it will necessarily already be in one of
the other fields.
NOTE : we DON ' T store : name becuse it will necessarily already be in one of the other fields .
# NOTE: this requires that richness has been calculated. Too expensive to do it here: