Guest User

Untitled

a guest
Jul 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class CachedStats < ActiveRecord::Base
  2.  
  3. #
  4. # Finds all cached statistics that cover the given _timestamp_.
  5. #
  6. def self.covering(timestamp)
  7. self.find(
  8. :all,
  9. :conditions => [
  10. 'created_at >= ? AND DATE_ADD(created_at, INTERVAL expiration DAYS)',
  11. timestamp.gmtime
  12. ]
  13. )
  14. end
  15.  
  16. end
Add Comment
Please, Sign In to add comment