summaryrefslogtreecommitdiff
path: root/app/queries/reviews/has_user_already_posted_review_query.rb
blob: 182f12e077cbe1c7bd0a4ca02e134fb604300baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal

module Reviews
  # HasUserAlreadyPostedReviewQuery
  class HasUserAlreadyPostedReviewQuery
    def initialize(product)
      @product = product
    end

    def review_posted?(user_account_id)
      ProductReview.find_by(user_account_id:, product_id: @product.id).present?
    end
  end
end