|
class StaticProjectAttachments < ActiveRecord::Migration
|
|
def up
|
|
Project.all.each do |project|
|
|
unless project.attachments.nil?
|
|
attachments_count = project.attachments.count
|
|
project.update_attribute(:attachments_count, attachments_count)
|
|
end
|
|
end
|
|
end
|
|
|
|
def down
|
|
end
|
|
end
|