ç¹ç°ã¡ã½ãããalias_methodã使ç¨ãã¦å¥åãã¤ãããã¨ããã¨ã¨ã©ã¼ã«ãªãã ã ããåããããã¯å ã§respond_to?(:find)ãå®è¡ããã¨trueãè¿ãããã undefined method `find' for class `ActiveRecord::Base' (NameError) module EffectiveRails module ActiveRecord def self.included(klass) klass.send ClassMethods klass.class_eval do p respond_to?(:find) # => true alias_method_chain :find, :explain end end module ClassMethods def find_with_explain(*args) # hogehoge
{{#tags}}- {{label}}
{{/tags}}