Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created October 2, 2009 21:22
Show Gist options
  • Save edavis10/200147 to your computer and use it in GitHub Desktop.
Save edavis10/200147 to your computer and use it in GitHub Desktop.
module PatchingProjectForEirikb
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
# Same as typing in the class
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
after_save :do_something
end
end
module ClassMethods
end
module InstanceMethods
def do_something
# Shell out or whatever here...
end
end
end
require 'dispatcher'
Dispatcher.to_prepare do
Project.send(:include, PatchingProjectForEirikb)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment