Created
          May 30, 2013 14:32 
        
      - 
      
- 
        Save esparkman/5678283 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
    
  
  
    
  | # before this block there is an if condition to make sure it is an AR instance | |
| # it is all being wrapped in an Array and has (approvables being passed in) | |
| # then iterated over to give us approvable | |
| ActiveRecord::Base.transaction do | |
| approvable.build(:previously_approved => true) | |
| approvable.build(:approved_at => Time.zone.now) | |
| approvable.build(:approved_by_id => approved.try(:id)) | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment