Sha256: 71ec12da6bb0946b920deee988f398d27f7342e04151762c55b420c5d5e9f414

Contents?: true

Size: 494 Bytes

Versions: 6

Compression:

Stored size: 494 Bytes

Contents

class CreateShoppeProductCategoryTranslationTable < ActiveRecord::Migration
  def up
    Shoppe::ProductCategory.create_translation_table! :name => :string, :permalink => :string, :description => :text

    Shoppe::ProductCategory.all.each do |pc|
      l = pc.translations.new
      l.locale = "en"
      l.name = pc.name
      l.permalink = pc.permalink
      l.description = pc.description
      l.save!
    end
  end
  def down
    Shoppe::ProductCategory.drop_translation_table!
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
shoppe-1.1.2 db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb
shoppe-1.1.1 db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb
shoppe-1.1.0 db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb
shoppe-1.0.9 db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb
shoppe-1.0.8 db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb
kylekthompson-shoppe-1.0.7 db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb