Skip to content

Instantly share code, notes, and snippets.

@radar
Created April 2, 2012 17:06
Show Gist options
  • Select an option

  • Save radar/2285176 to your computer and use it in GitHub Desktop.

Select an option

Save radar/2285176 to your computer and use it in GitHub Desktop.
how does this look
class MailerObserver < ActiveRecord::Observer
observer :device, :device_problem, :device_location
def after_create(device_problem)
DeviceMailer.problem_device(device_problem.device).deliver
end
def after_save(device_location)
# count active device_locations for location and check against par_levels
# send alert email if necessary
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment