Browse Source

only run query for scheme locations size once

Co-authored-by: Dushan <dushan@madetech.com>
pull/713/head
Kat 3 years ago
parent
commit
e12ff6f11b
  1. 3
      app/models/derived_variables/case_log_variables.rb

3
app/models/derived_variables/case_log_variables.rb

@ -8,7 +8,8 @@ module DerivedVariables::CaseLogVariables
def scheme_has_multiple_locations?
return false unless scheme
scheme.locations.size > 1
@scheme_locations_count ||= scheme.locations.size
@scheme_locations_count > 1
end
def set_derived_fields!

Loading…
Cancel
Save