Files
brewery/app/models/user.rb
T
2023-08-10 20:02:11 +03:00

11 lines
286 B
Ruby

class User < ApplicationRecord
include RatingAverage
validates :username, uniqueness: true, length: { minimum: 3, maximum: 30 }
has_many :ratings
has_many :beers, through: :ratings
has_many :memberships, dependent: :destroy
has_many :beer_clubs, through: :memberships
end