Sha256: 4335f3846b58953ba49173dc8ea6c27f0505b89bee63ca77a855215957ecfed2
Contents?: true
Size: 570 Bytes
Versions: 18
Compression:
Stored size: 570 Bytes
Contents
module Migration ## # This migration sets the Spotlight::Page locale to the I18n.default_locale. # Needed for migrating Exhibits to internationalization work. class PageLanguage def self.run new.run end def initialize; end def run migrate_pages end private def migrate_pages FriendlyId::Slug.where(sluggable_type: 'Spotlight::Page').find_each do |slug| unless /locale:\w+/ =~ slug.scope slug.scope += ",locale:#{I18n.default_locale}" slug.save end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems