exchange-rates 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2f7997cf5b23a8e2efbabf40f4d89d98210b4640f197e3302c03ac5f2f72a3d
4
- data.tar.gz: cb35b7a6ea58f2b3213b732bb7f7b6ee2d1141153e16fe10b89496aec60530c9
3
+ metadata.gz: e5135c81812d1e95366d3b3c1dd1b17a007c4a4ea9642d2cf6322410eeec2d64
4
+ data.tar.gz: 255160ee5f78ab244bc125c4d61ca3e02ecc810a26891c7f03574b28f32d0a02
5
5
  SHA512:
6
- metadata.gz: 7de2585b973295a58729984273a4c68c8b4d75884ab755d96806412afa01f1e1eb4c96f7ac2220d2e5541d4219ee81c6069959cf075224f64063b45dd70e5d7a
7
- data.tar.gz: 12d3c62911061ae9c2eefb65bdc4b3f0997402c49f4edb09eda8e7242d8f66bb8a9d2233a727bca1906fda7ab7de38eaae842555e4b67029ad623134535f6b73
6
+ metadata.gz: 1bfa5b3d17faa76defff63c458a3429dda2545b5de4df070336c0bc57536c49c847f199269cee514e3b1aae111af3995b812f8deccb6dd945b21fd8fb47a74fb
7
+ data.tar.gz: c20420d833474f8b0ff83261078d9db36f27b6ed8bac87e77e240f912e92b2b68b7e5c470585efe77860c3827f0151e9549b4b0bb7d043d89ecb20a97717841d
@@ -26,7 +26,7 @@ module ExchangeRates
26
26
 
27
27
  def self.get_rate(currency)
28
28
  return 1 if currency == BASE_CURRENCY
29
- cached = Rails.cache.fetch("#{currency.downcase}_to_#{BASE_CURRENCY.downcase}", expired_at: Date.today.midnight + ENV['RESET_CACHED_CURRENCY_AT'].to_i.hours, race_condition_ttl: 5) do
29
+ cached = Rails.cache.fetch("#{currency.downcase}_to_#{BASE_CURRENCY.downcase}", expires_in: 1.day, race_condition_ttl: 5) do
30
30
  where(from_currency: currency).first.rate_to_base_currency
31
31
  end
32
32
  cached || where(from_currency: currency).first.rate_to_base_currency
@@ -1,3 +1,3 @@
1
1
  module ExchangeRates
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exchange-rates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - aloha