Skip to content

Instantly share code, notes, and snippets.

@mixonic
Created May 2, 2012 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mixonic/2578362 to your computer and use it in GitHub Desktop.
Save mixonic/2578362 to your computer and use it in GitHub Desktop.
class Task
after_save :nofity_for_next_tasks
def notify!
unless user_notified? # This is a new column
send_actual_email_somehow(task, user)
update_attribute(:user_notified, true)
end
end
private
def notify_for_next_tasks
candidate.nofity_for_next_tasks
end
end
class Candidate
def notify_for_next_tasks
current_stage = find_current_stage_somehow
current_stage.tasks.each do |task|
task.notify!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment