tabletop-companion/app/models/character.rb

13 lines
344 B
Ruby
Raw Permalink Normal View History

2024-06-05 15:00:02 +00:00
# frozen_string_literal: true
class Character < ApplicationRecord
belongs_to :table, optional: true
belongs_to :game_system
belongs_to :user
2024-06-05 18:45:45 +00:00
has_many :character_sheet_sections, dependent: :destroy
2024-06-10 19:39:46 +00:00
has_many :stats, through: :character_sheet_sections
2024-06-05 15:00:02 +00:00
validates :name, presence: true,
length: { maximum: 200 }
end