Skip to content

Instantly share code, notes, and snippets.

@chandeeland
Created July 9, 2020 20:11
Show Gist options
  • Save chandeeland/e6bfce2fcf935cae2fa192a147cd5a12 to your computer and use it in GitHub Desktop.
Save chandeeland/e6bfce2fcf935cae2fa192a147cd5a12 to your computer and use it in GitHub Desktop.
# this is useful for sending action cable updates to doctors portal
def spam(count, naptime)
patients = Patient.all.sample(count)
patients.each do |patient|
sleep(naptime) if naptime
Doctor.all.each do |doc|
DoctorSchema.subscriptions.trigger('patientUpdates', { doctorId: doc.id }, patient)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment