Skip to content

Instantly share code, notes, and snippets.

@digitaltoad
Created August 25, 2011 00:30
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 digitaltoad/1169659 to your computer and use it in GitHub Desktop.
Save digitaltoad/1169659 to your computer and use it in GitHub Desktop.
Overriding establish_connection
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