From c411ae05eaf9a2148d7a7af41dbc3abc2ad794ae Mon Sep 17 00:00:00 2001 From: Kirill Katashinsky Date: Thu, 1 Jun 2023 18:51:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/paperclip.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/paperclip.rb b/lib/paperclip.rb index ae017e1..22ee9c4 100644 --- a/lib/paperclip.rb +++ b/lib/paperclip.rb @@ -220,6 +220,7 @@ module Paperclip attachment_definitions[name] = Attachment.build_class(name, options) const_set("#{name}_attachment".camelize, attachment_definitions[name]) + # after_commit callback-и исполняются в обратном порядке их определения after_commit :flush_attachment_jobs after_commit :save_attached_files, on: %i[create update] after_commit :destroy_attached_files, on: :destroy