mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-16 20:49:26 -04:00
don't pass photos to crops/_photos
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
- if photos.size.positive?
|
||||
- if crop.photo_associations_count.positive?
|
||||
%h2 #{photo_icon} Photos
|
||||
- [Crop, Planting, Harvest, Seed].each do |model_name|
|
||||
- if photos.by_model(model_name).size.positive?
|
||||
- if crop.photos.by_model(model_name).size.positive?
|
||||
%h3 #{@crop.name.capitalize} #{t("activerecord.models.#{model_name.to_s.downcase}.other")}
|
||||
= render 'photos/gallery', photos: photos.by_model(model_name).includes(:owner).order(likes_count: :desc).limit(5)
|
||||
= render 'photos/gallery', photos: crop.photos.by_model(model_name).includes(:owner).order(likes_count: :desc).limit(5)
|
||||
= link_to 'more photos »', crop_photos_path(@crop), class: 'btn'
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
%section.photos
|
||||
= cute_icon
|
||||
= render 'crops/photos', photos: @photos, crop: @crop
|
||||
= render 'crops/photos', crop: @crop
|
||||
|
||||
- if @crop.plantings.any?
|
||||
%section.charts
|
||||
|
||||
Reference in New Issue
Block a user