Skip to content

Instantly share code, notes, and snippets.

@maxim
Created January 19, 2009 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxim/49159 to your computer and use it in GitHub Desktop.
Save maxim/49159 to your computer and use it in GitHub Desktop.
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