Cache values for historical queries#6
Conversation
namespace cache key custom cache and defaults
There was a problem hiding this comment.
Pass &:set as an argument to dont_allow instead of a block.
|
Hi @zapnap, I was actually thinking to implement something like this in a near future but looks like you overtake me :) I'm in a big squeeze currently so just give me few days to review the pull request. |
|
Great thanks! lmk. |
|
Hi @zapnap, I finally got time for a review. Sorry for waiting so long. I think configuration could be simplified if we replace OpenExchangeRates.configure do |config|
config.app_id = "YourAppID"
config.cache_store = :memory
endIf symbol or string is defined we use it to get class name. I would move adapters from In Base I would define Maybe it would be good idea to write Rails adapter. It would map to Rails.cache http://guides.rubyonrails.org/caching_with_rails.html, and if you for example set Rails cache to use Redis then all you have to do is Do we need expire at option and/or method to clean up the cache? In most cases you would want to keep rates in cache but what if cache gets full? Should we leave that to the users or should we add something like I'm not sure how Please fix Hound (Rubocop) https://houndci.com/configuration#ruby issues also. If some rule is not logical to you we can discuss it. Let me know what you think. |
|
These are good questions, and definitely should be addressed (except for some of the hound issues ;-). A couple quick comments:
Unfortunately, I don't a whole lot of time at the moment (actually, no time at all). But will keep this in mind. |
This was something we really needed for a project. Thoughts and suggestions welcome.