Created
          December 24, 2016 18:24 
        
      - 
      
 - 
        
Save bleonard/96c014ee26e00365c2d01ba938ea5ee6 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
    
  
  
    
  | class Profile::ContentSubscriber | |
| include ResqueBus::Subscriber | |
| subscribe :post_created | |
| def post_created(attributes) | |
| profile = Profile::Document.find_by(user_id: attributes['post_author_id']) | |
| profile.post_ratings_total = attributes['total_ratings'] | |
| profile.post_rating_average = attributes['new_average'] | |
| profile.save! | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment