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)