wedding-planner/app/models/tables_arrangement.rb
Manuel Bustillo 066fdea504
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 3m52s
Run unit tests / unit_tests (pull_request) Successful in 7m40s
Build Nginx-based docker image / build-static-assets (pull_request) Failing after 1h10m25s
Assign a name to every tables arrangement
2024-11-03 08:44:31 +01:00

15 lines
296 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
class TablesArrangement < ApplicationRecord
has_many :seats
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