Quick question about userstamping records in a similar way to
timestamping. There is an example of how this might work at:
This seems to work fine on my development system. However, I am not
sure how the User.current_user method, which is required, can guarantee
to return the correct user since this is a static accessor/method. If I
set the class-level current_user as part of my request processing, then
so long as no other requests come in in the mean time, all well and
good. however, if some other request is made by a different user
between me setting the current user and saving the record, then
presumably the record will be stamped with the other user.
Is there something special about class scope within rails, i.e. is it
scoped per request? Otherwise, what is the correct way to go about
I’m no great Ruby expert, but have been using it for a while.