mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
11 lines
196 B
Ruby
11 lines
196 B
Ruby
class Beer < ApplicationRecord
|
|
include RatingAverage
|
|
|
|
belongs_to :brewery
|
|
has_many :ratings, dependent: :destroy
|
|
|
|
def to_s
|
|
"#{name}, #{(Brewery.find_by_id brewery_id).name}"
|
|
end
|
|
end
|