Permalink
Browse files

nil.to_i is 0

  • Loading branch information...
1 parent 760a931 commit 71f957ebe2b6969c01bed60806491f03b94a552e @tompesman committed Sep 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tasks/push_tasks.rake
@@ -2,7 +2,7 @@
namespace :push do
desc "Delete all push messages and feedback older than 7 days or DAYS=x if defined (where x is an integer)"
task :clean => :environment do
- days = ENV["DAYS"].to_i || 7
+ days = ENV["DAYS"] ? ENV["DAYS"].to_i : 7
puts "Removing #{days} days of push messages and feedback"
feedback = Push::Feedback.where("created_at < ?", days.days.ago).delete_all
messages = Push::Message.where("created_at < ?", days.days.ago).delete_all

0 comments on commit 71f957e

Please sign in to comment.