namespace :forum do desc "sync visits for memos" task :tech => :environment do Memo.where(:forum_id => 5).find_each do |memo| if memo.viewed_count.to_i < 1000 memo.update_column(:viewed_count, memo.viewed_count.to_i * 2) end end end end