Sha256: 987f7c3f9483589e8660aeff80d331315786a62697fbae6f622adab191056a19

Contents?: true

Size: 801 Bytes

Versions: 14

Compression:

Stored size: 801 Bytes

Contents

# -*- encoding : utf-8 -*-

class MenuCompatibility < Card::CoreMigration
  def up

    # Add bootswatch shared to old skins so that menu works
    bootswatch_shared = Card[:bootswatch_shared]
    Card.search(type_id: Card::SkinID) do |skin|
      if skin.item_cards.find { |item_card| item_card.codename.to_s == 'style_bootstrap_compatible'}
        skin.add_item! bootswatch_shared.name
      end
    end

    # Delete output files so all the styling and js changes take effect.
    # (this can be removed if/when later migrations update those things directly)
    [:style, :script].each do |setting|
      Card.search(
        right_id: Card::MachineOutputID,
        left: { right: {codename: setting.to_s } }
      ).each do |output_card|
        output_card.delete!
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
card-1.17.4 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.17.3 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.17.2 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.17.1 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.17.0 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.15 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.14 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.13 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.12 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.11 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.10 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.9 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.8 db/migrate_core_cards/20150508212032_menu_compatibility.rb
card-1.16.7 db/migrate_core_cards/20150508212032_menu_compatibility.rb