Are class attributes thread safe? For instance, the userstamp plugin
creates a User.current_user attribute and then it aliases the
ActiveRecard create and update methods to write created_by and
updated_by attributes using the value of User.current_user. For some
reason I can imagine a case where multiple users are logged in at the
same time and saving objects, and the value of User.current_user would
It could be that I’m applying too much “Javathink” because this kind of
class attribute would be a problem in Java (of course its more
complicated with class loaders and such). But I can’t help but think
that ruby may have some difficulty in this situation, too.
The answer to this question may depend upon what web server is used
and/or how the rails app is being served. Is there a single,
straight-up answer to this question?