Skip to content
Snippets Groups Projects
Unverified Commit 8d4c0093 authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

menu never saved/touch in auto-gen, so no need anymore (#1873)

parent 93233bcf
No related branches found
No related tags found
No related merge requests found
......@@ -6,14 +6,9 @@ module Communication::Website::Menu::WithAutomatism
end
def generate_automatically
begin
pause_git_sync
transaction do
clear_items
create_items
end
ensure
unpause_git_sync
transaction do
clear_items
create_items
end
end
......@@ -23,11 +18,6 @@ module Communication::Website::Menu::WithAutomatism
protected
def pause_git_sync
Communication::Website::Menu.skip_callback :save, :after, :connect_dependencies
Communication::Website::Menu.skip_callback :touch, :after, :connect_dependencies
end
def clear_items
# We don't use the destroy method to prevent items' callbacks
items.delete_all
......@@ -55,9 +45,4 @@ module Communication::Website::Menu::WithAutomatism
parent: parent_item
create_items_for_children_of(page, item)
end
def unpause_git_sync
Communication::Website::Menu.set_callback :save, :after, :connect_dependencies
Communication::Website::Menu.set_callback :touch, :after, :connect_dependencies
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