Created
August 25, 2011 00:30
-
-
Save digitaltoad/1169659 to your computer and use it in GitHub Desktop.
Overriding establish_connection
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 Interceptor | |
def self.included(base) | |
base.class_eval do | |
alias_method :establish_connection_before_interception, :establish_connection | |
def establish_connection | |
"intercepted" | |
end | |
end | |
end | |
end | |
ActiveRecord::Base.send(:include, Interceptor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment