Sha256: 7582c8a139e1a4bf2a3dd6dd86ba5ce0d95694add5a6c62e93cc10d50267d37f
Contents?: true
Size: 601 Bytes
Versions: 81
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true 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
81 entries across 81 versions & 1 rubygems