AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
818 stars 312 forks source link

Add dependent: :nullify to Page#nodes #2828

Closed mamhoff closed 3 months ago

mamhoff commented 3 months ago

What is this pull request for?

If a page is used in a node, we need to nullify that page_id upon destruction. Otherwise we get foreign key constraint errors.

mamhoff commented 3 months ago

We already throw an exception when this happens in the UI. Closing this PR.

Regarding #2829 we might want to do the same there? What do you think?