Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get access to the app variable in a rake task

How can I get an instance of ActionDispatch::Integration::Session in a rails rake task.

I want to be able to call: app.get '/' like you can do in the rails console.

like image 832
Trent Earl Avatar asked Dec 26 '22 00:12

Trent Earl


1 Answers

 task :get_app => :environment do
    app = ActionDispatch::Integration::Session.new Rails.application
 end
like image 125
Trent Earl Avatar answered Dec 28 '22 13:12

Trent Earl