harvest search, fixed error when some data not set on model

This commit is contained in:
Brenda Wallace committed 2020-01-01 08:41:00 +13:00
1 parent 80038c7f42
commit 36875b620c
1 file changed
+5 -5
+5 -5
View File
@@ -29,18 +29,18 @@ module SearchHarvests
owner_id: owner_id,
owner_login_name: owner_login_name,
owner_slug: owner_slug,
plant_part_name: plant_part_name,
plant_part_name: plant_part&.name,
#planting
# planting
planting_id: planting_id,
planting_slug: planting_slug,
planting_slug: planting&.slug,
#photo
# photo
has_photos: photos.size.positive?,
thumbnail_url: default_photo&.thumbnail_url || crop.default_photo&.thumbnail_url,
# counts
harvests_count: harvests_count,
# harvests_count: harvests_count,
photos_count: photos.count,
# timestamps