Skip to content

Instantly share code, notes, and snippets.

@meltingice
Created May 24, 2017 14:17
Show Gist options
  • Save meltingice/e979eb15c7ea8c82f5936fe86d93ee4f to your computer and use it in GitHub Desktop.
Save meltingice/e979eb15c7ea8c82f5936fe86d93ee4f to your computer and use it in GitHub Desktop.
comments.
reject { |comment|
# Comment is deleted with no children, always hide
next true if deleted?(comment) && comment['children'].empty?
# Comment is your own, always show
next false if is_own_comment?(comment)
# Pending comment with no replies
next true if pending?(comment) && comment['children'].empty?
# Comment is good, keep it
false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment