summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-04 19:53:27 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-04 19:53:27 -0600
commit72ccdfdf9bbea6269bc1a28199373abd5e8ce302 (patch)
treedf69179a101d71e9fe8ae22753c3bb7a95f8e5e7 /app/models
parentdb9b4b712271a67e60e6c0bf58c9ce510f177682 (diff)
Añade specs de ReviewsController
Diffstat (limited to 'app/models')
-rw-r--r--app/models/product_review.rb2
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?