diff options
author | HombreLaser <sebastian-440@live.com> | 2023-04-04 19:53:27 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-04-04 19:53:27 -0600 |
commit | 72ccdfdf9bbea6269bc1a28199373abd5e8ce302 (patch) | |
tree | df69179a101d71e9fe8ae22753c3bb7a95f8e5e7 /app/models | |
parent | db9b4b712271a67e60e6c0bf58c9ce510f177682 (diff) |
Añade specs de ReviewsController
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? |