Sha256: f260a03434e3852d55db25e3f214232409bb7e00c5bd0984b0eb7d89c3bcb064

Contents?: true

Size: 1.19 KB

Versions: 12

Compression:

Stored size: 1.19 KB

Contents

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

class MoveHelpTextToCode < Cardio::Migration::Core
  def up
    update_card! "*sidebar", codename: "sidebar"
    Card::Cache.reset_all

    # avoid that "list" as input option gets the description of the cardtype "list"
    ensure_card %i[input right options_label], "options description"

    remove_setting_help_rules
    remove_search_help_rules
    remove_self_help_rules :favicon, :tiny_mce, :favicon, :datepicker, "*debugger",
                           :prose_mirror, :sidebar
  end

  def remove_search_help_rules
    %i[created edited children includes refers_to links_to included_by linked_to_by
       referred_to_by mates editors follow].each do |trait|
      delete_card [trait, :right, :help]
    end
  end

  def remove_setting_help_rules
    %i[script input read update create delete accountable add_help autoname captcha create
       default structure comment follow_fields options thanks layout options_label help
       head table_of_contents style on_create on_update on_delete].each do |trait|
      delete_card [trait, :right, :help]
    end
  end

  def remove_self_help_rules *anchors
    anchors.each do |a|
      delete_card [a, :self, :help]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
card-1.104.2 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.104.1 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.104.0 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.103.4 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.103.3 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.103.2 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.103.1 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.103.0 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.101.7 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.102.0 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.101.6 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb
card-1.101.5 db/migrate_core_cards/20190822093633_move_help_text_to_code.rb