tabletop-companion/app/models/template.rb

15 lines
416 B
Ruby
Raw Permalink Normal View History

2024-06-29 08:16:37 +00:00
# frozen_string_literal: true
class Template < ApplicationRecord
belongs_to :game_system
validates :name, presence: true,
uniqueness: { scope: :game_system_id },
length: { maximum: 200 }
validates :content, presence: true
validates :klass, presence: true,
length: { maximum: 200 }
2024-07-03 16:28:09 +00:00
scope :game_system, ->(game_system) { where(game_system:) }
2024-06-29 08:16:37 +00:00
end