Sha256: cd3abf8b7629159c75754966edeced55457778099c808717982a968809e8f2d0
Contents?: true
Size: 527 Bytes
Versions: 12
Compression:
Stored size: 527 Bytes
Contents
class PopulateTranslations < ActiveRecord::Migration def self.globalizable_content Globalize2Extension::GLOBALIZABLE_CONTENT end def self.up globalizable_content.each do |model, columns| model.send(:all).each do |item| translation = item.translations.find_or_initialize_by_locale(Globalize2Extension.default_language.to_s) columns.each do |column| translation[column] = item[column] end translation.save end end end def self.down end end
Version data entries
12 entries across 12 versions & 1 rubygems