Compare commits
2 Commits
fcb1e77a3a
...
006b1893c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 006b1893c1 | |||
| 9f7f99f3f4 |
@ -17,7 +17,7 @@ class AffinityGroupsHierarchy < Array
|
|||||||
hydrate(group)
|
hydrate(group)
|
||||||
end
|
end
|
||||||
|
|
||||||
load_discomforts
|
discomforts
|
||||||
freeze
|
freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -58,9 +58,9 @@ class AffinityGroupsHierarchy < Array
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def load_discomforts
|
def discomforts
|
||||||
@load_discomforts ||= GroupAffinity.pluck(:group_a_id, :group_b_id,
|
@discomforts ||= GroupAffinity.pluck(:group_a_id, :group_b_id,
|
||||||
:discomfort).each_with_object({}) do |(id_a, id_b, discomfort), acc|
|
:discomfort).each_with_object({}) do |(id_a, id_b, discomfort), acc|
|
||||||
acc[uuid_to_int(id_a) + uuid_to_int(id_b)] = discomfort
|
acc[uuid_to_int(id_a) + uuid_to_int(id_b)] = discomfort
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user