Sha256: 21c9e551f5adc4d8bb66806c6dd096e5d5734487d4be40a26f008772fcfad573

Contents?: true

Size: 287 Bytes

Versions: 2

Compression:

Stored size: 287 Bytes

Contents

class EmptyTiesCount < ActiveRecord::Migration
  def up
    change_column :contacts, :ties_count, :integer, :default => 0

    Contact.record_timestamps = false
    Contact.all.each do |c|
      c.update_attribute(:ties_count, 0) if c.ties_count.nil?
    end
  end

  def down
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_stream-base-0.6.3 db/migrate/20110705103202_empty_ties_count.rb
social_stream-base-0.6.2 db/migrate/20110705103202_empty_ties_count.rb