Re: adding custom cache field

Hello Jong,

“Jong Hian Zin” [email protected] wrote:

Hi Surendra,

Thanks for the code. I guess I have to modify rails core, i.e.
associations.rb associations/association_collection.rb and base.rb to add in
the code, is that correct?

Nope, you don’t need to touch the rails core at all. Just add files in
the lib
folder and paste this code. You will be good to use it.

Ruby has this excellent facility which allows one to add functions to an
already existing class.

When I get more time, I will try putting up a blog entry explaining this

Hope this helps.

Surendra S.,
Read my blog at:
| “O thou my friend! The prosperity of Crime is like unto the lightning,
| whose traitorous brilliancies embellish the atmosphere but for an
| instant, in order to hurl into death’s very depths the luckless one
| they have dazzled.” – Marquis de Sade

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs