Created
October 2, 2009 21:22
-
-
Save edavis10/200147 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 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