Skip to content

Commit

Permalink
Merge pull request #474 from unepwcmc/delete-pages-with-custom-catego…
Browse files Browse the repository at this point in the history
…ries

added dependent destroy on pages categories to allow deletion
  • Loading branch information
stacytalbot authored Aug 11, 2020
2 parents 3e3df6f + 502c594 commit 8666dc2
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 8666dc2

Please sign in to comment.