From 32c8698a445dd4f23621a6768f160a992e37af4d Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 12 Jan 2020 10:17:07 +1300 Subject: [PATCH] style fix ups --- app/models/concerns/search_crops.rb | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/models/concerns/search_crops.rb b/app/models/concerns/search_crops.rb index b37fbfcc1..959627436 100644 --- a/app/models/concerns/search_crops.rb +++ b/app/models/concerns/search_crops.rb @@ -6,16 +6,16 @@ module SearchCrops included do #################################### # Elastic search configuration - searchkick word_start: %i(name description alternate_names scientific_names), + searchkick word_start: %i(name description alternate_names scientific_names), case_sensitive: false, - searchable: %i(name descriptions alternate_names scientific_names), + searchable: %i(name descriptions alternate_names scientific_names), merge_mappings: true, - mappings: { + mappings: { properties: { - created_at: { type: :integer }, + created_at: { type: :integer }, plantings_count: { type: :integer }, - harvests_count: { type: :integer }, - photos_count: { type: :integer } + harvests_count: { type: :integer }, + photos_count: { type: :integer } } } @@ -28,21 +28,21 @@ module SearchCrops def search_data { - name: name, - description: description, - slug: slug, - alternate_names: alternate_names.pluck(:name), + name: name, + description: description, + slug: slug, + alternate_names: alternate_names.pluck(:name), scientific_names: scientific_names.pluck(:name), - photos_count: photo_associations_count, + photos_count: photo_associations_count, # boost the crops that are planted the most - plantings_count: plantings_count, - harvests_count: harvests_count, + plantings_count: plantings_count, + harvests_count: harvests_count, # boost this crop for these members - planters_ids: plantings.pluck(:owner_id), - has_photos: photos.size.positive?, - thumbnail_url: thumbnail_url, - scientific_name: default_scientific_name&.name, - created_at: created_at.to_i + planters_ids: plantings.pluck(:owner_id), + has_photos: photos.size.positive?, + thumbnail_url: thumbnail_url, + scientific_name: default_scientific_name&.name, + created_at: created_at.to_i } end end