Last active
          March 17, 2016 14:33 
        
      - 
      
- 
        Save xhoy/c04d207c3fe1bc466fe7 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
    
  
  
    
  | DOES NOT WORK: | |
| {% for invoice in relation.invoices.late %} | |
| <tr> | |
| <td>{{invoice.id}}</td> | |
| <td>{{invoice.print_date}}</td> | |
| <td>{{invoice.days_late}}</td> | |
| <td>{{invoice.priceinbtw}}</td> | |
| </tr> | |
| {% endfor %} | |
| DOES WORK | |
| {% for invoice in relation.invoices %} | |
| <tr> | |
| <td>{{invoice.id}}</td> | |
| <td>{{invoice.print_date}}</td> | |
| <td>{{invoice.days_late}}</td> | |
| <td>{{invoice.priceinbtw}}</td> | |
| </tr> | |
| {% endfor %} | 
  
    
      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
    
  
  
    
  | class Relation < ActiveRecord::Base | |
| has_many :invoices | |
| liquid_methods :full_name, :invoices, :letter_head | |
| end | |
| class Invoice < ActiveRecord::Base | |
| scope :late, -> {unpayed.where("print_date < ? ", (Time.now-APP_CONFIG['betaalinformatie']['termijn'].days))} | |
| liquid_methods :days_late, :priceinbtw, :print_date, :id, :late, :unpayed | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment