Sha256: f3b2f1145a80319e250f7143e35556d0cc43ff09fff238c8b4de8972b90f8845

Contents?: true

Size: 438 Bytes

Versions: 11

Compression:

Stored size: 438 Bytes

Contents

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

# delete brackets from card content
class OutWithTheBrackets < Cardio::Migration
  def up
    Card["*getting started links"]&.update_column :type_id, :link_list.card_id

    list_type_ids = %i[pointer list].map(&:card_id)
    ["[[", "]]"].each do |brackets|
      Card.where(type_id: list_type_ids).in_batches.update_all(
        "db_content = REPLACE(db_content, '#{brackets}', '')"
      )
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
card-mod-list-0.15.6 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.5 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.4 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.3 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.2.pre1 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.1.1 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.1 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.15.0 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.14.2 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.14.1 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
card-mod-list-0.14.0 db/migrate_core_cards/20211107155032_out_with_the_brackets.rb