wedding-planner/app/models/tables_arrangement.rb

25 lines
560 B
Ruby
Raw Permalink Normal View History

2024-10-27 21:42:45 +00:00
# Copyright (C) 2024 Manuel Bustillo
# == Schema Information
#
# Table name: tables_arrangements
#
# id :uuid not null, primary key
# discomfort :integer
# name :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
class TablesArrangement < ApplicationRecord
has_many :seats
2024-11-02 10:40:43 +01:00
has_many :guests, through: :seats
before_create :assign_name
private
def assign_name
self.name = "#{Faker::Adjective.positive} #{Faker::Creature::Animal.name}".capitalize
end
end