When set to true, the user will be notified by email when a backup process raises an exception before finishing
When set to true, the user will be notified by email when a backup process ends without raising any exceptions
When set to true, the user will be notified by email when a backup process is successful, but has warnings
When set to true, the user will be notified by email when a backup process raises an exception before finishing
Performs the notification Takes a flag to indicate that a failure has occured. (this is only set from Model#perform! in the event of an error) If this is the case it will set the 'action' to :failure. Otherwise, it will set the 'action' to either :success or :warning, depending on whether or not any warnings were sent to the Logger. It will then invoke the notify! method with the 'action', but only if the proper on_success, on_warning or on_failure flag is true.
# File lib/backup/notifier/base.rb, line 45 def perform!(failure = false) @template = Backup::Template.new({:model => @model}) action = false if failure action = :failure if notify_on_failure? else if notify_on_success? || (notify_on_warning? && Logger.has_warnings?) action = Logger.has_warnings? ? :warning : :success end end if action log! notify!(action) end end
Generated with the Darkfish Rdoc Generator 2.