Created
January 19, 2009 20:36
-
-
Save maxim/49159 to your computer and use it in GitHub Desktop.
This file contains 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 HasAsset | |
def included base | |
base.class_eval do | |
before_create :add_asset | |
before_update :edit_asset | |
end | |
end | |
private | |
def edit_asset | |
logger.info "[ASSET] editing" | |
end | |
def add_asset | |
logger.info "[ASSET] adding" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment