contentful_rails
contentful_rails copied to clipboard
Using caching and the preview API simultaneously is impossible
Due to the following code, it is impossible to test caching while also testing the preview API - would it be possible to separate these concepts so that both could be used at the same time?
def updated_at_with_caching
if ContentfulRails.configuration.perform_caching && !ContentfulModel.use_preview_api
Rails.cache.fetch(self.timestamp_cache_key) do
updated_at_without_caching
end
else
updated_at_without_caching
end
end
Hey @ericgross,
Sorry I took so long to respond,
I'm currently working on a new release of this gem to match the 1.0.0 release of contentful_model, I'm going to think about this and consider adding it. I'll update you on the decision once I've discussed it with my team.
Cheers