I have library code that overrides Ar\'s find method. I also include the module for all Association classes so both MyModel.find and @parent.my_models.find work and apply the co
'Pedro's answer is right, but there's a small mistake.
def self.included(base)
class << base
base.extend ClassMethods
end
end
should be
def self.included(base)
base.extend ClassMethods
end
Using class << base ... end has the effect of calling 'extend' on 'base' in the class-method scope, but there is no method 'base' in ActiveRecord::Base so an error is thrown. Using base.extend by itself will call the 'extend' method of ActiveRecord::Base.