From f795c28c5a20ab411ef3df378845052cc3979d79 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Sat, 5 May 2018 20:24:35 -0300 Subject: [PATCH] User after_commit in stead of after_save --- app/models/dunlop/source_file_model.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/dunlop/source_file_model.rb b/app/models/dunlop/source_file_model.rb index 65b809f..e180213 100644 --- a/app/models/dunlop/source_file_model.rb +++ b/app/models/dunlop/source_file_model.rb @@ -32,7 +32,7 @@ module Dunlop::SourceFileModel event(:failed) { transition any => :failed } end - after_create { autoload! } + after_commit { autoload! } self::Job = Class.new "#{name.deconstantize}::ApplicationJob".constantize do def perform(source_file_id)