Merge pull request 'Fix error loading arrangements' (#217) from fix/error-loading-arrangements into main
All checks were successful
Check usage of free licenses / check-licenses (push) Successful in 1m24s
Run unit tests / unit_tests (push) Successful in 1m31s
Build Nginx-based docker image / build-static-assets (push) Successful in 28m7s

Reviewed-on: #217
This commit is contained in:
bustikiller 2025-01-23 20:49:01 +00:00
commit 006b1893c1

View File

@ -17,7 +17,7 @@ class AffinityGroupsHierarchy < Array
hydrate(group)
end
load_discomforts
discomforts
freeze
end
@ -58,8 +58,8 @@ class AffinityGroupsHierarchy < Array
private
def load_discomforts
@load_discomforts ||= GroupAffinity.pluck(:group_a_id, :group_b_id,
def discomforts
@discomforts ||= GroupAffinity.pluck(:group_a_id, :group_b_id,
:discomfort).each_with_object({}) do |(id_a, id_b, discomfort), acc|
acc[uuid_to_int(id_a) + uuid_to_int(id_b)] = discomfort
end