docbrown/lib/data_update_scripts/20220830153942_generate_display_ad_names.rb
Ridhwana 3d3e5156a3
Add "name" field to Display Ads (#18396)
* feat: create a migration to add the display ad name column to the tanle

* feat: add a display ad name to the interface

* feat: add a display ad name after create

* feat: whoops the migration file

* feat: add a DUS to update previous Display Ads names

* fix: test

* refactor: update the name after_save

* fix: add name to params
2022-09-02 16:29:33 +02:00

9 lines
218 B
Ruby

module DataUpdateScripts
class GenerateDisplayAdNames
def run
DisplayAd.where(name: nil).find_each do |display_ad|
display_ad.update(name: "Display Ad #{display_ad.id}")
end
end
end
end