Merge pull request #88 from kirill555101/changed_commits_order

Меняем порядок callback-ов
This commit is contained in:
Vasily Fedoseyev
2023-06-01 18:54:11 +03:00
committed by GitHub

View File

@@ -220,9 +220,10 @@ module Paperclip
attachment_definitions[name] = Attachment.build_class(name, options) attachment_definitions[name] = Attachment.build_class(name, options)
const_set("#{name}_attachment".camelize, attachment_definitions[name]) const_set("#{name}_attachment".camelize, attachment_definitions[name])
after_commit :save_attached_files # after_commit callback-и исполняются в обратном порядке их определения
after_commit :destroy_attached_files, on: :destroy
after_commit :flush_attachment_jobs after_commit :flush_attachment_jobs
after_commit :save_attached_files, on: %i[create update]
after_commit :destroy_attached_files, on: :destroy
define_paperclip_callbacks :post_process, :"#{name}_post_process" define_paperclip_callbacks :post_process, :"#{name}_post_process"