Guest User

Untitled

a guest
May 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def notifications
  2. new_array = []
  3. new_array << friends_for_me.collect(&:id)
  4. new_array << friends_by_me.collect(&:id)
  5.  
  6. logger.info puts new_array
  7. #The Logger outputs
  8. #99
  9. #95
  10. #96
  11. #98
  12.  
  13. #99
  14. #95
  15. #96
  16. #98
  17.  
  18. friends = new_array.compact.join(' OR ')
  19. logger.info puts friends
  20. #outputs
  21. #99 OR 95 OR 96 OR 98
  22. #99 OR 95 OR 96 OR 98
  23.  
  24. Notification.find(:all, :conditions => { :source_user_id => friends }, :limit => 10 )
  25. end
Add Comment
Please, Sign In to add comment