search for: anhelpermethod

Displaying 1 result from an estimated 1 matches for "anhelpermethod".

2006 Jun 18
4
share an hash ..
Hello, How to share an Hash between all objects (model, controller ect ...) => I did a static Hash in my model where a static method fill it basically, this is the code class Person < ActiveModel @@anHash.new def Person.anHelperMethod(aKey) if anHash.size==0 ... load the hash, some SQL to fill the Hash end return anHash[aKey] end => The problem,: it always reload the Hash ! as it was a local variable .... I don''t understand since it has the good behavior in the console env .... thanks for he...