How to get current_user in model and observer Rails

If you want to log the user who created, updates and delete a object in specific model.There is no default way to fetch the current user in models, current_user is always assigned in controllers (as per authentication plugins, restful_authentication, authlogic and devise). Found one way, by adding some steps in model/user.rb, we can get the […]

‘Confirmation token is invalid’ when confirming after registering in Devise gem

I got stuck for sometime by getting the issue. When registering a new user with :confirmable in my devise user model, when the user clicks on the e-mail confirmation link, they receive an “Invalid confirmation token” error message Found some solution by searching about this, config.allow_insecure_token_lookup = true (Never do it in your devise initilizer […]