dev_shixuns
daiao 6 years ago
parent 729c079738
commit 5a41e4a15f

@ -2,8 +2,11 @@ namespace :myshixun do
desc "delete gpid is no" desc "delete gpid is no"
task :delete_error_myshixuns => :environment do task :delete_error_myshixuns => :environment do
begin begin
myshixuns = Myshixun.where(gpid: nil) myshixuns = Myshixun.where("gpid is null and created_at > '#{Time.now.beginning_of_day}'")
myshixuns.delete_all myshixuns.find_each do |m|
m.destroy
puts("#myshixun_id: #{m.id}")
end
rescue Exception => e rescue Exception => e
puts e puts e
end end

Loading…
Cancel
Save