Custom_fields updated simultaneous cause value to turn into array

something like this? Seems to work.

DistributedMutex.synchronize("user_data_update_#{user.id}") do
    user.save_custom_fields(true)
end