clerk icon indicating copy to clipboard operation
clerk copied to clipboard

Issue when using devise/activeadmin

Open fokcep opened this issue 11 years ago • 3 comments

Looks like there is threading issue in your gem. When I use it with activeadmin on login - a user being updated (with ip address, timestamp) but creator/updater are set to a wrong user. Probably the last user used by the system? And on some logins it doesn't update to any user - i.e. user not yet available in the filter chain?

Any ideas?

fokcep avatar May 22 '13 10:05 fokcep

this gem uses sentient_user see https://github.com/bokmann/sentient_user/blob/master/lib/sentient_user.rb which is using Thread.current - i have encountered similar issues that you describe.

I've been using a System Account user and setting that as the default if the logged on user cannot be determined, but i think with devise when the user is authenticating they are not actually logged on until after their attributes (ip, etc) are updated; you might not be able to set the System Account without overriding the devise controller before the authentication occurs

house9 avatar May 22 '13 14:05 house9

thanks for the tip, I will check the devise controller and see if it can be fixed there

fokcep avatar May 22 '13 18:05 fokcep

I got a similar issue with RailsAdmin, where an admin user when updates the record, the updated_by_id field is not updated. When I try from the console, it is updated as needed.

SaraswatiSaud avatar Aug 14 '18 05:08 SaraswatiSaud