I don’t know whether this is a bug or feature, and I don’t know whether
this belongs to Gmailer (http://rubyforge.org/projects/gmailutils) in
specific or Rails/Ruby in general.
I have an instance method in an ActiveRecord model, that upon a web
request using WEBrick, spawns off a thread, in which it invokes Gmailer
to perform some processing. What fails is that simply after the call:
(that is, even without performing any connection-related task yet), one
of the model’s method (as well as the model member objects’ methods)
strangely disappears (become undefined) and the code cannot proceed as
ERROR is reported when trying to invoke that missing method right after.
When invoking this ActiveRecord model’s method directly inside
script/console, everything proceeds beautifully…! Anyone knows what
may be going on here? This is too tricky…
What’s interesting is that if the method doesn’t spawn off a thread and
instead directly invokes Gmailer and the subsequent code, everything
works under WEBrick… Does this have anything to do with how
threading works under WEBrick as well?
Thanks for sharing any thoughts, suggestions or workarounds,