Displaying 2 results from an estimated 2 matches for "cached_record".
2007 Jan 05
0
ActiveResource cache using memcache-client
...9;'localhost'')
# test the connection to the Memcache server
@@cache.get(1)
rescue MemCache::MemCacheError
@@cache = nil
end
# See ActiveResource::Base.find for method description
def self.find(*args)
if args.length == 1 && args.first.is_a?(Fixnum)
cached_record = self.cache_read(args.first)
return cached_record if cached_record
end
# if find(int) is not a cache hit or if the
# find is more complex, do the find as normal
# and cache the answers
records = super(*args)
case records
when Array
records.each {|r| r.ca...
2006 Jun 18
13
Currency calculation
I''m thinking of experimenting with some currency conversion. However,
I''d like the conversions to be in synch with the current rates.
Anyone know (and this maybe out in left field) if there is some online
(perhaps xml) or other data stream I can connect with in my code to
output values based on user selection ?
TIA
Stuart