Files
nairobi/db/migrate/20210106132909_make_cards_polymorphic.rb
Javi Martín ee29ca43a5 Make widget cards polymorphic
So now we'll be able to add them to other sections.

We're also adding a `dependent: :destroy` relation to models having
cards since it doesn't make sense to have cards around when their page
has been destroyed.
2021-01-14 17:37:58 +01:00

9 lines
250 B
Ruby

class MakeCardsPolymorphic < ActiveRecord::Migration[5.2]
def change
change_table :widget_cards do |t|
t.rename :site_customization_page_id, :cardable_id
t.string :cardable_type, default: "SiteCustomization::Page"
end
end
end