Class: OnlineMigrations::DataMigrations::UpdateSnowMeltMatArticleUrls
- Inherits:
-
OnlineMigrations::DataMigration
- Object
- OnlineMigrations::DataMigration
- OnlineMigrations::DataMigrations::UpdateSnowMeltMatArticleUrls
- Defined in:
- lib/online_migrations/data_migrations/update_snow_melt_mat_article_urls.rb
Overview
Update article solution URLs from old snow-melting-mat product line to
the new snowmelt-powermat product line.
Enqueued by: 20251223190000_enqueue_update_snow_melt_mat_article_urls.rb
Replaces in article.solution text:
/products/line/snow-melting-mat -> /products/line/snowmelt-powermat
The old parent "Mat" product line (ID 40, URL snow-melting-mat) has been
split into three sub-product lines: PowerMat, OmniMat, and EcoMat.
PowerMat is the default product for existing references.
Constant Summary collapse
- BATCH_SIZE =
Batch size.
100- OLD_URL =
URL for old.
'/products/line/snow-melting-mat'- NEW_URL =
URL for new.
'/products/line/snowmelt-powermat'
Instance Method Summary collapse
Instance Method Details
#collection ⇒ Object
24 25 26 |
# File 'lib/online_migrations/data_migrations/update_snow_melt_mat_article_urls.rb', line 24 def collection Article.where('solution ILIKE ?', "%#{OLD_URL}%").in_batches(of: BATCH_SIZE) end |