Skip to content

Commit f923e94

Browse files
committed
presenters: add memoization to WorkshopPresenter#venue
Use @venue ||= to cache the host sponsor, preventing redundant calls to model.host which could trigger additional queries in certain contexts.
1 parent 6edf01c commit f923e94

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/presenters/workshop_presenter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def attending_and_available_coach_spots
2828
end
2929

3030
def venue
31-
model.host
31+
@venue ||= model.host
3232
end
3333

3434
def organisers

0 commit comments

Comments
 (0)