Skip to content

Instantly share code, notes, and snippets.

@excid3
Created July 2, 2012 15:25
Show Gist options
  • Select an option

  • Save excid3/3033777 to your computer and use it in GitHub Desktop.

Select an option

Save excid3/3033777 to your computer and use it in GitHub Desktop.
class Paging < ActiveRecord::Base
#Associations
def send_mail
if medic_id?
PagingMailer.blah(medic, message).deliver
elsif unit_id?
PagingMailer.blah(unit.in_charge, message).deliver
PagingMailer.blah(unit.attendant, message).deliver
end
end
end
# Call this in your controller after @paging.save by doing @paging.send_mail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment