[Rails] Re: Any way to avoid instantiating a class twice?

2009-10-01 Thread Brian Hogan
Persist that information to some other storage engine on your server, per user. The database is the first place I'd think of. Using database sessions removes the session limit. However, look into Memcached, MongoDB, CouchDB, and other options. They're pretty cool. Also, maybe have someone else

[Rails] Re: Any way to avoid instantiating a class twice?

2009-10-01 Thread jemminger
Is there any way around this situation?  Is there some way to keep the instantiated class alive so it can be used in subsequent actions? Sure, for the non user-specific parts, you can lazy-load and cache: class Expensive def self.share_me @some_val ||= expensive_calculation end