Hi, guys. I wrote a rake task that called a method in model A.
task :update_number => :environment do
in model A
t1 = A.find.all
When I ran the rake task, it returned an error “undefined local variable
or method t1”. If I copied codes in the method to app.rake, it worked
perfectly. Did I miss something when I called the method in model from
Thanks in advance.