diff --git a/app/controllers/admin/communication/blocks/headings_controller.rb b/app/controllers/admin/communication/blocks/headings_controller.rb index 3074a898a1f4c04905fb4967e593d5e1ed541786..329ee29613482c15cdf36951e393e74e8e287d19 100644 --- a/app/controllers/admin/communication/blocks/headings_controller.rb +++ b/app/controllers/admin/communication/blocks/headings_controller.rb @@ -24,7 +24,6 @@ class Admin::Communication::Blocks::HeadingsController < Admin::Communication::B def create if @heading.save - sync_with_git_if_necessary redirect_to about_path, notice: t('admin.successfully_created_html', model: @heading.to_s) else @@ -35,7 +34,6 @@ class Admin::Communication::Blocks::HeadingsController < Admin::Communication::B def update if @heading.update(heading_params) - sync_with_git_if_necessary redirect_to about_path, notice: t('admin.successfully_updated_html', model: @heading.to_s) else @@ -48,18 +46,12 @@ class Admin::Communication::Blocks::HeadingsController < Admin::Communication::B def destroy path = about_path @heading.destroy - sync_with_git_if_necessary redirect_to path, notice: t('admin.successfully_destroyed_html', model: @heading.to_s) end protected - def sync_with_git_if_necessary - return unless @heading.about.respond_to?(:sync_with_git) - @heading.about.sync_with_git - end - # TODO factorize def website_id params[:website_id] || @heading.about&.website.id diff --git a/app/models/communication/block/heading.rb b/app/models/communication/block/heading.rb index 8df7855648db4599504fd8854c63d963a5ee1981..bdb9685db4ea6b8be4af76fd0e60d378aa96d610 100644 --- a/app/models/communication/block/heading.rb +++ b/app/models/communication/block/heading.rb @@ -26,6 +26,7 @@ # fk_rails_ae82723550 (university_id => universities.id) # class Communication::Block::Heading < ApplicationRecord + include AsIndirectObject include Sanitizable include WithPosition include WithUniversity