13 lines
314 B
Ruby
13 lines
314 B
Ruby
|
class StaticProjectAttachments < ActiveRecord::Migration
|
||
|
def up
|
||
|
Project.all.each do |project|
|
||
|
attachments_count = project.attachments.count
|
||
|
project.update_attribute(:attachments_count, attachments_count)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
Project.all.update_all(:attachments_count => false)
|
||
|
end
|
||
|
end
|