2025-01-13 20:38:47 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2025-01-13 21:37:02 +01:00
|
|
|
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
2024-10-27 21:42:45 +00:00
|
|
|
|
2024-12-28 18:37:47 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-11-13 08:12:46 +00:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: seats
|
|
|
|
#
|
|
|
|
# id :uuid not null, primary key
|
|
|
|
# table_number :integer
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
# guest_id :uuid not null
|
|
|
|
# tables_arrangement_id :uuid not null
|
2024-11-30 20:04:17 +01:00
|
|
|
# wedding_id :uuid not null
|
2024-11-13 08:12:46 +00:00
|
|
|
#
|
|
|
|
# Indexes
|
|
|
|
#
|
|
|
|
# index_seats_on_guest_id (guest_id)
|
|
|
|
# index_seats_on_tables_arrangement_id (tables_arrangement_id)
|
2024-11-30 20:04:17 +01:00
|
|
|
# index_seats_on_wedding_id (wedding_id)
|
2024-11-13 08:12:46 +00:00
|
|
|
#
|
|
|
|
# Foreign Keys
|
|
|
|
#
|
|
|
|
# fk_rails_... (guest_id => guests.id)
|
|
|
|
# fk_rails_... (tables_arrangement_id => tables_arrangements.id) ON DELETE => cascade
|
2024-11-30 20:04:17 +01:00
|
|
|
# fk_rails_... (wedding_id => weddings.id)
|
2024-11-13 08:12:46 +00:00
|
|
|
#
|
2024-08-01 18:27:41 +00:00
|
|
|
class Seat < ApplicationRecord
|
2024-11-30 20:04:17 +01:00
|
|
|
acts_as_tenant :wedding
|
2024-08-01 18:27:41 +00:00
|
|
|
belongs_to :guest
|
|
|
|
belongs_to :table_arrangement
|
|
|
|
end
|