app/models/alchemy/page.rb in alchemy_cms-6.0.8 vs app/models/alchemy/page.rb in alchemy_cms-6.0.9

- old
+ new

@@ -127,9 +127,14 @@ validates_presence_of :parent, unless: -> { layoutpage? || language_root? } before_create -> { versions.build }, if: -> { versions.none? } + before_destroy if: -> { nodes.any? } do + errors.add(:nodes, :still_present) + throw(:abort) + end + before_save :set_language_code, if: -> { language.present? } before_save :set_restrictions_to_child_pages, if: :restricted_changed?