diff --git a/app/models/communication/website/git_file.rb b/app/models/communication/website/git_file.rb index 996b1edc2626ac1981895e19aff6825640cb3259..8546aa66134bda5d412cbbc2402328cd136d89ee 100644 --- a/app/models/communication/website/git_file.rb +++ b/app/models/communication/website/git_file.rb @@ -27,6 +27,7 @@ class Communication::Website::GitFile < ApplicationRecord attr_accessor :will_be_destroyed def self.sync(website, object, destroy: false) + # Permalinks must be calculated BEFORE renders object.manage_permalink_in_website(website) if Communication::Website::Permalink::MAPPING.keys.include?(object.class.to_s) object.before_git_sync # Handle optional before-sync process git_file = where(website: website, about: object).first_or_create