Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (12 sloc) 287 Bytes
namespace :cron do
desc 'Every day cron job'
task :every_day => :environment do
$db.establish_connection
sql = <<-SQL
DELETE
FROM requests
WHERE updated_at < '#{1.day.ago.utc.to_s(:sql)}'
SQL
puts "#{$db.delete(sql)} requests destroyed"
end
end
Jump to Line
Something went wrong with that request. Please try again.