Skip to content

Commit

Permalink
added dependent destroy on pages categories to allow deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleypliu committed Aug 11, 2020
1 parent 4cc3b8f commit 502c594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/comfy_patching.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Rails.configuration.to_prepare do
Comfy::Cms::Page.class_eval do
has_many :pages_categories, foreign_key: 'page_id'
has_many :pages_categories, foreign_key: 'page_id', dependent: :destroy
has_many :page_categories, through: :pages_categories, foreign_key: 'page_id'

has_many :topics, -> { joins(:layout_category).where("comfy_cms_layout_categories.label = 'topics'") },
Expand Down

0 comments on commit 502c594

Please sign in to comment.