time_elapser

Time-elapser Create timestamps query caching friendly

Usage

TimeElapser.sanitize(interval)

*interval means how often it is going to change

Example - Rails

Product.find(:all, :conditions => ['available_date <= ?', TimeElapser.sanitize(5)])

This will create queries during between 2000-01-01 00:00:00 and 2000-01-01 00:00:04 like this:

select * from products where available_date = '2000-01-01 00:00:00'

Allowing query cache to actually cache the results longer.

TODO

Contributing to time_elapser

Copyright © 2010 CrowdInt. See LICENSE.txt for further details.