Created
          October 25, 2013 04:39 
        
      - 
      
- 
        Save dnch/7149498 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # suffers the obvious problem that Time.now is evaluated at load, not on-call... | |
| def prior_to(issue_date = Time.now) | |
| where("issue_date < ?", issue_date).order(:issue_date).reverse_order | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
prior_to(issue_date)
issue_date ||= Time.now
..