socialforge/db/migrate/20160111071529_static_proje...

14 lines
268 B
Ruby
Raw Normal View History

2016-01-12 10:38:50 +08:00
class StaticProjectNews < ActiveRecord::Migration
def up
Project.all.each do |project|
unless project.news.nil?
news_count = project.news.count
project.update_attribute(:news_count, news_count)
end
2016-01-12 10:38:50 +08:00
end
end
def down
end
end