From: "Florian Groß" Date: 2005-11-10T02:35:53+09:00 Subject: Re: memoize and yaml Brian Buckley wrote: > Cool. I had been thinking I wanted to use your version of Memoize in > conjunction with Rails' ActiveRecord::Base but ActiveRecord::Base > requires one to 'extend' it to use it. However it occurred to me that > since ActiveRecord::Base does not extend anything I could just extend > it instead of my actual class. It seems to work. > > class ActiveRecord::Base > extend Memoize > end > > class Foo < ActiveRecord::Base > def calc > ... > end > memoize :calc > end Please note that extend is not the same thing as inheriting from another class. You can inherit from ActiveRecord::Base and still have a extend(Memoize).