From fc900140391ddcbd59a64a3bc47d7155c7c2fd55 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 11 Feb 2025 03:06:54 -0800 Subject: [PATCH] Ensure numericality --- app/models/grid_weapon.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/grid_weapon.rb b/app/models/grid_weapon.rb index 212f9a5..a618dda 100644 --- a/app/models/grid_weapon.rb +++ b/app/models/grid_weapon.rb @@ -39,6 +39,10 @@ class GridWeapon < ApplicationRecord belongs_to :awakening, optional: true + # Validate that uncap_level and transcendence_step are present and numeric. + validates :uncap_level, presence: true, numericality: { only_integer: true } + validates :transcendence_step, presence: true, numericality: { only_integer: true } + validate :compatible_with_position, on: :create validate :no_conflicts, on: :create