Class: Domternal::Generators::MigrateFromActionTextGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Domternal::Generators::MigrateFromActionTextGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/domternal/migrate_from_action_text/migrate_from_action_text_generator.rb
Overview
rails g domternal:migrate_from_action_text
Copies every action_text_rich_texts row into domternal_rich_texts, rewriting the
Instance Method Summary collapse
Instance Method Details
#create_migration_file ⇒ Object
21 22 23 24 |
# File 'lib/generators/domternal/migrate_from_action_text/migrate_from_action_text_generator.rb', line 21 def create_migration_file migration_template "migrate_action_text_to_domternal.rb.tt", "db/migrate/migrate_action_text_to_domternal.rb" end |
#show_notes ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/generators/domternal/migrate_from_action_text/migrate_from_action_text_generator.rb', line 26 def show_notes say "\n Review the generated migration before running it. It:\n\n * copies bodies verbatim (both use sanitized HTML, so no conversion is needed)\n * turns image attachments into <img> tags on Active Storage redirect URLs, which\n is the same markup the editor's upload handler writes\n * re-attaches the referenced blobs as Domternal::RichText embeds\n * leaves action_text_rich_texts untouched, so you can roll back\n\n Non-image attachables (ActionText::Attachable models of your own) are dropped unless\n you tell it what to render \u2014 see ATTACHABLE_REPLACEMENTS in the migration.\n NOTES\nend\n", :green |