Created
          November 16, 2013 16:01 
        
      - 
      
- 
        Save thoughtshop/7501856 to your computer and use it in GitHub Desktop. 
    TransactionReport vs TransactionReport per StaffMember
  
        
  
    
      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
    
  
  
    
  | if clumsy | |
| staff_members = StaffMember.alphabetical | |
| @reports = staff_members.map {|s| [ s, TransactionReport.where(:staff_member_id => s.id).where(:created_at => @date_range) ]} | |
| end # 3000ms | |
| if smart | |
| report = TransactionReport.where(:created_at => @date_range) | |
| @reports = report.group_by(&:staff_member).sort_by{|g| [g.first.last_name, g.first.first_name] } | |
| end # 8000ms | 
        
      
            lcowell
  
      
      
      commented 
        Nov 16, 2013 
      
    
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment