Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created May 2, 2011 21:36
Show Gist options
  • Select an option

  • Save dpickett/952434 to your computer and use it in GitHub Desktop.

Select an option

Save dpickett/952434 to your computer and use it in GitHub Desktop.
module IsModerated
def is_moderated(options = {})
after_save :deliver_moderation_mail, :on => :create
end
protected
def deliver_moderation_mail
#do the good stuff
end
end
#I'm a fan of intentionally extending a class, but I added this for potential convenience
ActiveRecord::Base.extend IsModerated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment