From 6f85c31b598fecbad838d75d6a7d96f377402740 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 16 Aug 2023 15:14:53 +0100 Subject: [PATCH] feat: memoise lettings forms --- app/models/form_handler.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/form_handler.rb b/app/models/form_handler.rb index 8cbd5a2e5..1ef74b265 100644 --- a/app/models/form_handler.rb +++ b/app/models/form_handler.rb @@ -75,6 +75,10 @@ class FormHandler end def lettings_forms + @lettings_forms ||= get_lettings_forms + end + + def get_lettings_forms forms = {} directories.each do |directory| Dir.glob("#{directory}/*.json").each do |form_path|