summaryrefslogtreecommitdiff
path: root/app/models/product.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/product.rb')
-rw-r--r--app/models/product.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/product.rb b/app/models/product.rb
index e6f3720..b9ca828 100644
--- a/app/models/product.rb
+++ b/app/models/product.rb
@@ -11,6 +11,8 @@
class Product < ApplicationRecord
belongs_to :company
+ has_many :product_reviews
+
validates :name, presence: true
validates :unitary_price, presence: true
validates :unitary_price, comparison: { greater_than: 0 }