Skip to content
Snippets Groups Projects
Unverified Commit 21eb2ea9 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

#338

parent 509c6174
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ class Communication::Block < ApplicationRecord
}
before_save :update_template_images
after_update_commit :save_and_sync_about
after_commit :save_and_sync_about, on: [:update, :destroy]
def data=(value)
value = JSON.parse value if value.is_a? String
......@@ -71,7 +71,7 @@ class Communication::Block < ApplicationRecord
protected
def save_and_sync_about
about.save_and_sync
about&.save_and_sync unless about&.destroyed?
end
def update_template_images
......
......@@ -2,7 +2,7 @@ module WithBlocks
extend ActiveSupport::Concern
included do
has_many :blocks, as: :about, class_name: 'Communication::Block'
has_many :blocks, as: :about, class_name: 'Communication::Block', dependent: :destroy
end
def git_block_dependencies
......
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