I have a little problem with derivatives. They are created and attached to a model in image_data field, but image_derivatives method returns empty hash.
Can anybody please help me with this issue? Maybe I’m doing something wrong?
I have a little problem with derivatives. They are created and attached to a model in image_data field, but image_derivatives method returns empty hash.
This can happen if you’ve updated the image_data
column value after loading the derivatives from it (should be fixable by calling i.image_attacher.reload
). I think it can also happen if you have versions
plugin still loaded.
In any case, I would need you to produce a self-contained example that reproduces the problem. Or at least any relevant code executed before this screenshot.
Thank you for quick response.
No, I’ve never used versions
plugin. As you can see, I called i.image_derivatives
at a second line of console (first one was i = Image.last
), so I had no time to update the image_data
column. All I did before hat was uploading image as a part of db import (I used rails_admin_import
gem). I attached file like that:
attacher.assign(Down.open(url), metadata: metadata)
attacher.finalize
and than saved model.
By the way, I think it’s probably rails_admin_import
issue, but for some reason image is not promoted to the permanent storage during import save (everything works correctly when model is saved from rails_admin itself or console though), so I had to do it manually (using attacher.finalize
). But if you know how to fix this, please, tell me