【发布时间】:2015-02-22 09:10:17
【问题描述】:
谁能建议我哪里出错了?
我尝试执行以下任务,但以
结束rake aborted!
NoMethodError: undefined method 'perform' for main:Object
这是我的耙子任务
task :update_state_for_search_request => :environment do
t_last = MyModule.where("condition").last.id
t_first = 0
until t_first >= t_last do
t_first=print_id(t_first)
end
def perform(sid)
# action
my_data = MyModule.where("name='abcd' and id > #{sid}").limit(1000)
# action
return my_data.last.id
end
end
【问题讨论】: