Created
July 9, 2020 20:11
-
-
Save chandeeland/e6bfce2fcf935cae2fa192a147cd5a12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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