I am doing my ruby upgrade from ruby 2.7.3 to 3.2.2. Beside many other issues I handled alone. I am getting this one with Rails_Admin and edit object with image attached.
App is Rails 6.1.7 version and I am using shrine gem for image uploading 3.4. I have model event and creating event is okay but editing produce an error. When I try to open edit page I am getting:
Showing /home/zire/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rails_admin-3.1.2/app/views/rails_admin/main/_form_file_upload.html.erb where line #6 raised:
undefined method `url' for {:small=>#<StoryImageUploader::UploadedFile storage=:store id="403e525375510ed0575d905f52d58989.png" metadata={"filename"=>"image_processing20211129-7381-r1a05c.png", "size"=>16761, "mime_type"=>nil, "width"=>120, "height"=>59}>, :medium=>#<StoryImageUploader::UploadedFile storage=:store id="5a3b89da95d34693994a12baa71131a4.png" metadata={"filename"=>"image_processing20211129-7381-1158qla.png", "size"=>77113, "mime_type"=>nil, "width"=>360, "height"=>177}>, :featured=>#<StoryImageUploader::UploadedFile storage=:store id="0fec2d25a6662926126e123862245274.png" metadata={"filename"=>"image_processing20211129-7381-c97xn8.png", "size"=>463991, "mime_type"=>nil, "width"=>1140, "height"=>559}>}:Hash
on the line:
thumb && bindings[:object].public_send(:"#{name}", thumb).try(:url) || value.url
After lot of try I managed to fix the issue by updating that line to:
Definitely I think it need more attention and the issue is on the left side of || but for my case this is enough.
Here is my fork and commit for a reference: https://github.com/nezirz/rails_admin/commit/6fb120d21ddbc19cf39d736c14113bd4892411af