Sha256: 6bee06329d2c3f1112bc2e9e9aed8711e90135aa70cf7fe844eb8a52ea91428c

Contents?: true

Size: 395 Bytes

Versions: 10

Compression:

Stored size: 395 Bytes

Contents

class Metaphones < ActiveRecord::Migration
  def self.up
    add_column :tags, :metaphone, :string
    add_column :tags, :metaphone_secondary, :string
    Tag.reset_column_information
    Tag.all.each do |tag|
      tag.send :save    # metaphone is calculated before_save
    end
  end

  def self.down
    remove_column :tags, :metaphone
    remove_column :tags, :metaphone_secondary
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
radiant-taggable-extension-2.0.5 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.4 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.3 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.2 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.1 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.0 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.0.rc2 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-2.0.0.rc1 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-1.2.5 db/migrate/20110411075109_metaphones.rb
radiant-taggable-extension-1.2.4 db/migrate/20110411075109_metaphones.rb