1
0
Fork 0

Fix migration so it doesn't break things!

This commit is contained in:
Andrew Tomaka 2015-11-03 15:37:21 -05:00
parent c0bd723e31
commit a0be5a27d2

View file

@ -2,6 +2,7 @@ class AddLinksCounterCacheToCards < ActiveRecord::Migration
def up
add_column :cards, :links_count, :integer, default: 0, null: false
PaperTrail.whodunnit = 1
Card.reset_column_information
Card.find_each do |card|
card.update_attribute(:links_count, card.links.count)