Created
May 2, 2011 21:36
-
-
Save dpickett/952434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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