You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
286 B
10 lines
286 B
6 years ago
|
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
|