Guest User

Untitled

a guest
May 25th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. ## comment.rb (remove the 'unless' condition & ID comparison...)
  2.  
  3. self.newsfeed.permissions.notifiable_for_comments(self.id).each { |permission|
  4.  
  5. Mailer.deliver_comment_notification(permission.user, self)
  6. }
  7.  
  8. ## permission.rb (...and put it in to the named scope)
  9.  
  10. named_scope :notifiable_for_comments, lambda {|userid|
  11. {:conditions => ['user_id != ? AND status = ? AND comment_notifications = ?', userid, true, true]}
  12. }
Add Comment
Please, Sign In to add comment