From a81450ab73f0f629a92586aea63fca35f6cbe801 Mon Sep 17 00:00:00 2001 From: Eric Beringer Date: Thu, 6 Jul 2023 09:53:17 -0700 Subject: [PATCH] Fixing interaction with awesome nested set. It calls reload within the save which was clearing out the cache_id and skipping upload of file. --- lib/carrierwave/orm/activerecord.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/carrierwave/orm/activerecord.rb b/lib/carrierwave/orm/activerecord.rb index 434235aeb..87cbf9605 100644 --- a/lib/carrierwave/orm/activerecord.rb +++ b/lib/carrierwave/orm/activerecord.rb @@ -35,8 +35,10 @@ def mount_base(column, uploader=nil, options={}, &block) prepend mod mod.class_eval <<-RUBY, __FILE__, __LINE__+1 # Reset cached mounter on record reload - def reload(*) - @_mounters = nil + def reload(*args) + if args.size == 0 + @_mounters = nil + end super end