Closed jackc closed 3 years ago
@jackc, we have released a new 2.0.0 version. We have removed caching objects behavior in v2 to cache only object attributes. Thanks for the issue :+1:
:exclamation: See migration guide, v2 is not backward compatible with v1
It appears that the accessor method generated by
has_uploadcare_file
creates a newUploadcare::Rails::File
instance every time it is called.This means that calling
load_data
doesn't appear to have any effect unless the result is manually stored.Given:
This behavior at the console is surprising:
A quick look at the source reveals that
build_file
tries a lookup withRails.cache
, but it doesn't look like the file ever gets saved to the cache in the normal read case. Of course, that is beside the point of whether it makes sense for the accessor to create a new object every time, even if some of it is cached.