25 lines
571 B
Ruby
Raw Normal View History

2025-01-13 20:38:47 +00:00
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
2024-11-30 18:31:48 +00:00
# frozen_string_literal: true
2024-11-30 19:24:59 +01:00
# == 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/ }
2024-11-30 19:24:59 +01:00
end