diff options
-rw-r--r-- | app/models/product_review.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/product_review.rb b/app/models/product_review.rb index 49e344c..ceade9a 100644 --- a/app/models/product_review.rb +++ b/app/models/product_review.rb @@ -1,4 +1,12 @@ +# frozen_string_literal: true + +# ProductReview +# review: text +# rating: integer class ProductReview < ApplicationRecord belongs_to :user_account belongs_to :product + + validates :review, presence: true + validates :rating, presence: true, inclusion: { in: 1..5 } end |