From: "刘孟江" Date: 2006-05-18T16:18:49+09:00 Subject: alias_method hi, i want to extend the ActiveRecord::Base.establish_connection, i do it as fellow: module ActiveRecordExtension def self.included(klass) #nodoc klass.extend(ClassMethods) klass.class_eval do alias_method :old_establish_connection, :establish_connection alias_method :establish_connection, :my_establish_connection end end module ClassMethods def my_establish_connection(spec = nil) old_establish_connection(spec) end end end when it be included, then a error issue: ./lib/activerecord/extension.rb:18:in `alias_method': undefined method `establis h_connection' for class `ActiveRecord::Base' (NameError), but the ActiveRecord:Base.respond_to(:establis h_connection) is true. why?