Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CachedStats < ActiveRecord::Base
- #
- # Finds all cached statistics that cover the given _timestamp_.
- #
- def self.covering(timestamp)
- self.find(
- :all,
- :conditions => [
- 'created_at >= ? AND DATE_ADD(created_at, INTERVAL expiration DAYS)',
- timestamp.gmtime
- ]
- )
- end
- end
Add Comment
Please, Sign In to add comment