app/controllers/review_controller.rb
# there should be an easier way to do this
there should be an easier way to do this
there should be an easier way to do this
def remove_reviewed(posts)
      filtered_posts = posts
      posts.each do |post|
        post.reviews.each do |review|
          if review.user_id == current_user.id
            filtered_posts = filtered_posts.where.not(:id => post.id)
            break
          end
        end
      end
      return filtered_posts
    end
def remove_reviewed ( posts ) filtered_posts = posts posts . each do | post | post . reviews . each do | review | if review . user_id == current_user . id filtered_posts = filtered_posts . where . not ( :id => post . id ) break end end end return filtered_posts end
there should be an easier way to do this
there should be an easier way to do this
posts
<not_specific>