Closed ssugiyama closed 1 month ago
@ssugiyama
Thank you for reporting. I agree that this is better to be improved, but I want to understand one thing.
The expected usage is to have either f.hidden_field :image_cache
or f.hidden_field :image
, not both. What led you to to do so? Was there any instruction or something?
@mshibuya sorry for delay in my response
I make the entire form invisible, showing the image to users outside the form. That's why both image_cache and image are hidden fields. Maybe there's no need to worry about that as it's not essential.
Ah I meant, having both of :image_cache
and :image
is unexpected use case.
If you have followed the old way you should have only :image_cache
. And with new way I'd recommend only having :image
(mainly due to https://github.com/carrierwaveuploader/carrierwave/pull/2401).
So the question is, what's the reason you ended up having :image_cache
and :image
together?
I see! I just followed the old way. I will fix it to follow the current way.
Sorry for misreading you comment.
This is a legacy code of our project. I have misunderstood this is the correct way.
Maybe, we referred to this description. Do you mean the description is obsolete? @mshibuya
What's there is file_field
, not hidden_field
. If what you referred to was that one you should have misunderstood something.
Anyway closing this, as this seems to be a very exceptional case. Thank you for reporting.
Due to 4c65b393cd85b66bc256d04363cf3e3a97c8fd64, the following pseudo code begins to raise an error
when
complete
method is called fromconfirm
form which hasf.hidden_field :image_cache
andf.hidden_field :image
,foo.save
raises the following error.Due to 4c65b39, params[:image] turns to be the same as params[:image_cache]. Maybe this the reason of the behavior.
When the error was raised, the cache store seemed to have been already deleted.