mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-31 20:51:02 -05:00
get photo from crop (saved into ES)
This commit is contained in:
@@ -27,7 +27,7 @@ module HarvestSearch
|
||||
planting_id: planting_id,
|
||||
photos_count: photos.size,
|
||||
has_photos: photos.size.positive?,
|
||||
thumbnail_url: default_photo&.thumbnail_url,
|
||||
thumbnail_url: default_photo&.thumbnail_url || crop.default_photo&.thumbnail_url,
|
||||
created_at: created_at.to_i
|
||||
}
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ module PlantingSearch
|
||||
planted_from: planted_from,
|
||||
quantity: quantity,
|
||||
sunniness: sunniness,
|
||||
thumbnail_url: default_photo&.thumbnail_url,
|
||||
thumbnail_url: default_photo&.thumbnail_url || crop.default_photo&.thumbnail_url,
|
||||
created_at: created_at.to_i
|
||||
}
|
||||
end
|
||||
|
||||
@@ -31,10 +31,11 @@ module SeedSearch
|
||||
photos_count: photos.size,
|
||||
plant_before: plant_before,
|
||||
quantity: quantity,
|
||||
thumbnail_url: default_photo&.thumbnail_url,
|
||||
thumbnail_url: default_photo&.thumbnail_url || crop.default_photo&.thumbnail_url,
|
||||
tradable_to: tradable_to,
|
||||
tradeable: tradable?,
|
||||
finished: finished?,
|
||||
location: location,
|
||||
created_at: created_at.to_i
|
||||
}
|
||||
end
|
||||
@@ -43,7 +44,8 @@ module SeedSearch
|
||||
search('*',
|
||||
limit: limit,
|
||||
where: {
|
||||
photos_count: { gt: 0 }
|
||||
finished: false,
|
||||
tradeable: true,
|
||||
},
|
||||
boost_by: [:created_at],
|
||||
load: false)
|
||||
|
||||
Reference in New Issue
Block a user