Skip to content
Snippets Groups Projects
Commit ce8c179c authored by Arnaud Levy's avatar Arnaud Levy
Browse files

automatism stops on manual action

parent 7f250321
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ class Admin::Communication::Websites::Menus::ItemsController < Admin::Communicat
end
def create
@menu.stop_automatism!
@item.menu = @menu
@item.website = @website
if @item.save
......@@ -62,6 +63,7 @@ class Admin::Communication::Websites::Menus::ItemsController < Admin::Communicat
end
def update
@menu.stop_automatism!
if @item.update(item_params)
redirect_to redirect_path(@item),
notice: t('admin.successfully_updated_html', model: @item.to_s)
......
......@@ -30,6 +30,7 @@
class Communication::Website::Menu < ApplicationRecord
include AsDirectObject
include Sanitizable
include WithAutomatism
include WithTranslations
include WithUniversity
......
module Communication::Website::Menu::WithAutomatism
extend ActiveSupport::Concern
def create_automatic_menu
end
def stop_automatism!
update_column :automatic, false
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment