I realized when thinking about the user, password, and site variables in ActiveResource::Base, that they could be modified on one request and would remain modified on the next request. That seems like undesirable behavior, and possibly a widespread problem, since it applies to all use of class variables / attributes.
Does Rails provide a mechanism for cleaning up changes to class-level state (e.g. reset to default) so that each request starts in a pristine condition?
If not, would it be possible to add a way of initializing class variables which would get re-applied at the beginning of each request? This could be combined with thread-safe storage, making class variables much less problematic. A possible modification of class_attribute?
Update:
As I described in the linked question above, the specific case that brought this to my attention was the fact that I was setting ActiveResource::Base.user and password on a per-user basis. If I ever failed to reset them, that would mean that REST requests on behalf of one user would be made using the credentials of another on subsequent page loads.