diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/product_review.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/product_review.rb b/app/models/product_review.rb index 0985e7c..85804f2 100644 --- a/app/models/product_review.rb +++ b/app/models/product_review.rb @@ -11,6 +11,8 @@ class ProductReview < ApplicationRecord validates :rating, presence: true, inclusion: { in: 1..5 } validate :sole_user_review + paginates_per 15 + def sole_user_review return if ProductReview.find_by(user_account_id:, product_id:).nil? |