Sha256: 7152559484200eec0b4a71acb4c9c76ed05635b1ef5cad1f21a181ff2e6989ff

Contents?: true

Size: 654 Bytes

Versions: 22

Compression:

Stored size: 654 Bytes

Contents

class UpdateLinkableResourceTypes < ActiveRecord::Migration[5.2]
  def change
    change_column_default :spree_menu_items, :linked_resource_type, 'Spree::Linkable::Uri'

    Spree::MenuItem.where(linked_resource_type: 'URL').update_all(linked_resource_type: 'Spree::Linkable::Uri')
    Spree::CmsSection.where(linked_resource_type: 'URL').update_all(linked_resource_type: 'Spree::Linkable::Uri')
    Spree::MenuItem.where(linked_resource_type: 'Home Page').update_all(linked_resource_type: 'Spree::Linkable::Homepage')
    Spree::CmsSection.where(linked_resource_type: 'Home Page').update_all(linked_resource_type: 'Spree::Linkable::Homepage')
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spree_core-4.5.1 db/migrate/20211201202851_update_linkable_resource_types.rb
spree_core-4.5.0 db/migrate/20211201202851_update_linkable_resource_types.rb