Browse Source

memoize sales_forms (#1654)

# Context

- https://digital.dclg.gov.uk/jira/browse/CLDC-2384
- Optimize bulk upload performance for sales

# Changes

- Memoize a method which seems to be rather slow
pull/1655/head
Phil Lee 2 years ago committed by GitHub
parent
commit
54ef7d0c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/form_handler.rb

2
app/models/form_handler.rb

@ -33,7 +33,7 @@ class FormHandler
end
def sales_forms
{
@sales_forms ||= {
"current_sales" => Form.new(nil, current_collection_start_year, SALES_SECTIONS, "sales"),
"previous_sales" => Form.new(nil, previous_collection_start_year, SALES_SECTIONS, "sales"),
"next_sales" => Form.new(nil, next_collection_start_year, SALES_SECTIONS, "sales"),

Loading…
Cancel
Save