Re: [Rails-core] Object finalization help

2006-02-20 Thread Rick Bradley
* Adam Ballai ([EMAIL PROTECTED]) [060220 14:30]: > Is this the correct way to set a finalizer or am I going about it the > wrong way. I need to close a socket connection _after_ the model goes > out of scope where GC usually happens. Do models get GC'd after a page > is done loading? Adam, I

[Rails-core] Object finalization help

2006-02-20 Thread Adam Ballai
Heya guys, This one is bothering me as its evading my eye. I'm trying to set a callback on finalization of an object, ie: a finalizer set through a plugin to the model. Example In Plugin: def acts_as_goat class_eval do ObjectSpace.define_finalizer(self, lambda {self.conn.close} ) end end