简体   繁体   中英

Custom rails task not showing up/loading in rails 6

In rails-myapp/lib/tasks I have a custom task called orders.rake :

namespace :orders do
    desc "fetch orders" do
        task :fetch do
           # come code
        end
    end
end 

My understanding, this task should be available in the list when running rails -T .

I'm seeing this:

rails notes # fetch orders

Not sure this why the word of notes is showing up.

I supposed to be able to run this task by:

rails orders:fetch

Try so:

namespace :orders do
  desc "fetch orders"
  task :fetch do
    # come code
  end
end

Then:

rake orders:fetch

rake notes is a task that shows your TODO list

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM