Displaying 1 result from an estimated 1 matches for "kellys_find".
2005 Aug 08
0
Fwd: help me override ActiveRecord find?
...eRecord find?
To: ruby-talk-X+L+6nJQZ58h9ZMKESR00Q@public.gmane.org
I would like to add some things to the find method of activerecord, but I 
can''t figure out how to do this.
I''ve tried various things. Here is one example:
class Thing < ActiveRecord::Base
alias_method "kellys_find", "find"
def self.find(*args)
print "doing find\n";
kellys_find(args)
end
end
 
and I get this:
kellyf@sb61g2:/var/www/rl-dev$ script/console
Loading development environment.
irb(main):001:0> t1 = Thing.find(2)
NameError: undefined method `find'' for class `Thin...