mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
18 lines
334 B
Ruby
18 lines
334 B
Ruby
class Brewery < ApplicationRecord
|
|
include RatingAverage
|
|
|
|
has_many :beers, dependent: :destroy
|
|
has_many :ratings, through: :beers
|
|
|
|
def print_report
|
|
puts name
|
|
puts "established at year #{year}"
|
|
puts "number of beers #{beers.count}"
|
|
end
|
|
|
|
def restart
|
|
self.year = 2023
|
|
puts "changed year to 2023"
|
|
end
|
|
end
|