def cached_rate(original, target)
      if defined?(Rails)
        unless rate = Rails.cache.read("#{original}_#{target}_#{stringified_exchange_date}")
          rate = (1.0 / Rails.cache.read("#{target}_#{original}_#{stringified_exchange_date}")) rescue nil
        end
        rate
      end
    end
def cached_rate(original, target)
      if defined?(Rails)
        unless rate = Rails.cache.read("#{original}_#{target}_#{stringified_exchange_date}")
          rate = (1.0 / Rails.cache.read("#{target}_#{original}_#{stringified_exchange_date}")) rescue nil
        end
        rate
      end
    end
Tries to either get rate or calculate the inverse rate from cache.

 First looks for an "usd_eur_25-8-2010" entry in the cache,
 and if it does not find it, it looks for "eur_usd_25-8-2010" and
 inverts it.