Search code examples
ruby-on-railsrake-task

How to use current_user method in rake task rails


I creating a rake task for sending SMS to user from an Organisation which is signed in as current_user and I have to send the organisation name in the end which is stored in the organisation table. But the problem is that current_user method is not accessible in rake files.How can i solve this problem?


Solution

  • I found a solution where i can create a background job for the required fields in another table and this solve my problem as i have user_id in the table.