mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-28 01:38:26 -04:00
harvest search, fixed error when some data not set on model
This commit is contained in:
1 parent
80038c7f42
commit
36875b620c
1 file changed
+5
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user