lib/sequel/plugins/pg_array_associations.rb in sequel-5.43.0 vs lib/sequel/plugins/pg_array_associations.rb in sequel-5.44.0

- old
+ new

@@ -424,13 +424,15 @@ opts[:eager_loader] ||= proc do |eo| rows = eo[:rows] id_map = {} pkm = opts.primary_key_method - rows.each do |object| - if associated_pks = object.get_column_value(key) - associated_pks.each do |apk| - (id_map[apk] ||= []) << object + Sequel.synchronize_with(eo[:mutex]) do + rows.each do |object| + if associated_pks = object.get_column_value(key) + associated_pks.each do |apk| + (id_map[apk] ||= []) << object + end end end end eo = Hash[eo]