ratings are properly destroyed when user is deleted

This commit is contained in:
Aaro Koivukangas
2023-08-11 17:51:38 +03:00
parent e9987eef51
commit e4b2bbbfd9
+1 -1
View File
@@ -7,7 +7,7 @@ class User < ApplicationRecord
validates :password, length: { minimum: 3 }
validate :has_proper_characters_in_password
has_many :ratings
has_many :ratings, dependent: :destroy
has_many :beers, through: :ratings
has_many :memberships, dependent: :destroy
has_many :beer_clubs, through: :memberships