collectiveidea/awesome_nested_set

Carrierwave Uploads stopped working

Closed this issue · 4 comments

In my Rails 4.2 app, the file uploads stopped working for the model which has following
acts_as_nested_set counter_cache: :children_count, touch: true
Removing this line, the uploads starts working again.
I'm uploading adding content via RailsAdmin using Carrierwave and fog-google gems.

Moving acts_as_nested_set counter_cache: :children_count, touch: true after setting uploader in model solved this issue.

just remove depth column

@plusor I'm using multi level sets, so I think I need depth. I think my solution to just move the declaration after mounting uploaders is better because I don't need to change anything else. So far it's working fine.

I'm working on rails 6.0.3 and carrierwave 2.1.1 and awesome_nested_set 3.4.0. When I create a root category, the image is saved normally with other attributes. Somehow, when I create a sub-category, the image is not saved at all. I have tried both methods (remove depth column or put acts_as_nested_set after mount_uploader), but it still doesn't save the image for sub-category at all.