Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/models/event_cookbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def pdf # rubocop:disable Metrics/AbcSize
document.text "#{weekday_name(day.date)} #{formatted_date(day.date)}", size: 18, style: :bold, align: :center
document.move_down 15

day.daily_plan_recipes.includes(recipe: :recipe_ingredients).each do |daily_recipe|
if daily_recipes.is_a?(ActiveRecord::Relation)
daily_recipes = day.daily_plan_recipes.includes(recipe: :recipe_ingredients)
else
daily_recipes = day.daily_plan_recipes
end

daily_recipes.each do |daily_recipe|
next if daily_recipe.shopping?

recipe = daily_recipe.recipe
Expand Down
Loading