2024-11-30 18:31:48 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-12-28 18:37:47 +01: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
|
2024-12-01 18:17:07 +01:00
|
|
|
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
|