Sha256: 1b99e570b24acafd7e8d2f2e297e4bb9c63e42592fdbd9a29d72f35de4f72d9f

Contents?: true

Size: 534 Bytes

Versions: 6

Compression:

Stored size: 534 Bytes

Contents

class CreateShoppeProductTranslationTable < ActiveRecord::Migration
  def up
    Shoppe::Product.create_translation_table! :name => :string, :permalink => :string, :description => :text, :short_description => :text

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

Version data entries

6 entries across 6 versions & 2 rubygems

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