-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get model.id in store_dir #2689
Comments
We are using carrierwave 3.x with the same |
duplication should not affect the duplicated objects path
@ogawa5773 |
@rajyan For example, if create a User model like the one below and update the name property, the debug log described in initialize_dup will be output.
|
Maybe I'm missing something, but I couldn't reproduce this behavior. There might be a code calling dup somewhere else? Tested with the below Dockerfile
|
Thank you for checking.
And after you reported it, I checked and it seems that the counter_culture gem is using dup internally.
I have reproduced as below.
|
I see, thanks for the reproducible example! |
Thank you very much for guiding me to the solution. I'm thinking of stopping the use of counter_culture as an interim solution, but do you have any plans to fix this phenomenon in this gem? |
That's right. I've got it. I'll check #2690 out too. thank you very much. |
My Trouble
I'm trying to update the version from 2.x to 3.x.
While checking the operation associated with the version upgrade, we observed a phenomenon that model.id could not be obtained in store_dir and the path was different when uploading images and when referencing them.
example
If implement the above, the path difference will be like this
uploads/user/thumbnail
uploads/user/thumbnail/111
Question
While debugging, I confirmed that uploading and referencing can be done without problems by deleting the following line.
carrierwave/lib/carrierwave/orm/activerecord.rb
Line 46 in f31546a
I read the code there, but I can't understand the relationship that model.id can't be obtained. Can you give me a brief explanation, please? Also is it deprecated to use model.id in store_dir?
Memo
It has been confirmed that version 2 series (implementation below) is working without problems.
carrierwave/lib/carrierwave/orm/activerecord.rb
Line 99 in 2f91bee
Thanks.
The text was updated successfully, but these errors were encountered: