From 85c4c215720076a8080ac12a94822d7a02e08919 Mon Sep 17 00:00:00 2001 From: Robin Mehner Date: Wed, 26 Nov 2025 15:32:24 +0100 Subject: [PATCH] Add presence validation to platform and token to be consistent with the database --- app/models/action_push_native/device.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/action_push_native/device.rb b/app/models/action_push_native/device.rb index 2c6dff1..356ecb6 100644 --- a/app/models/action_push_native/device.rb +++ b/app/models/action_push_native/device.rb @@ -6,6 +6,9 @@ class Device < ApplicationRecord rescue_from(TokenError) { destroy! } + validates :platform, presence: true + validates :token, presence: true + belongs_to :owner, polymorphic: true, optional: true enum :platform, { apple: "apple", google: "google" }