Manuel Bustillo 5fb26f42d6
Some checks failed
Run unit tests / copyright_notice (pull_request) Successful in 57s
Run unit tests / check-licenses (pull_request) Failing after 2m13s
Run unit tests / rubocop (pull_request) Failing after 3m35s
Run unit tests / unit_tests (pull_request) Failing after 5m6s
Run unit tests / build-static-assets (pull_request) Has been skipped
Define a controller for invitations
2025-06-01 17:58:27 +02:00

27 lines
668 B
Ruby

# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
# frozen_string_literal: true
# == Schema Information
#
# Table name: weddings
#
# id :uuid not null, primary key
# slug :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_weddings_on_slug (slug) UNIQUE
#
class Wedding < ApplicationRecord
SLUG_REGEX = /[a-z\d-]+/
validates :slug, presence: true, uniqueness: true, format: { with: /\A#{SLUG_REGEX}\z/ }
has_many :guests, dependent: :delete_all
has_many :groups, dependent: :delete_all
has_many :invitations, dependent: :delete_all
end