mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
11 lines
286 B
Ruby
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
|