From 97c076b3c489c0dc81c7c3bb9ceddd35a86c01c5 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 26 May 2021 18:48:38 -0400 Subject: Set default Character wounds to 0 --- app/models/character.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models') diff --git a/app/models/character.rb b/app/models/character.rb index 92e84c7..c0f785f 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -17,6 +17,8 @@ class Character < ApplicationRecord validates_uniqueness_of :name, message: "is already being used" validates_format_of :name, with: /\A[a-z]+\z/i, message: "must consist of letters only" + attribute :wounds, :integer, default: 0 + after_create :create_skills after_create { Hearth.create(character: self) } -- cgit v1.2.3