mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-06 07:31:04 -05:00
Merge branch 'dev' into planting-reminders
This commit is contained in:
@@ -17,10 +17,11 @@ class GardensController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@current_plantings = @garden.plantings.current
|
||||
.includes(:crop, :owner)
|
||||
.order(planted_at: :desc)
|
||||
@current_plantings = @garden.plantings.current.includes(:crop, :owner).order(planted_at: :desc)
|
||||
@finished_plantings = @garden.plantings.finished.includes(:crop)
|
||||
@suggested_companions = Crop.approved.where(
|
||||
id: CropCompanion.where(crop_a_id: @current_plantings.select(:crop_id)).select(:crop_b_id)
|
||||
).order(:name)
|
||||
respond_with(@garden)
|
||||
end
|
||||
|
||||
|
||||
@@ -59,9 +59,8 @@
|
||||
|
||||
%section.companions
|
||||
%h2 Suggestioned companions
|
||||
- @garden.plantings.each do |planting|
|
||||
- planting.crop.companions.approved.each do |companion|
|
||||
= render 'crops/tiny', crop: companion
|
||||
- @suggested_companions.each do |companion|
|
||||
= render 'crops/tiny', crop: companion
|
||||
|
||||
%section= render 'previously'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user