From c95505d26c050d3936e4c6ee5b82befabc2307a9 Mon Sep 17 00:00:00 2001 From: Anton Katunin Date: Fri, 9 Aug 2024 14:59:18 +1000 Subject: [PATCH] Fix bug with plain objects --- lib/active_interaction/extras/model_fields.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_interaction/extras/model_fields.rb b/lib/active_interaction/extras/model_fields.rb index 1948b7f..a47e8a3 100644 --- a/lib/active_interaction/extras/model_fields.rb +++ b/lib/active_interaction/extras/model_fields.rb @@ -84,7 +84,7 @@ def any_changed?(*fields) model_field = self.class.model_field_cache_inverse[field] if model_field model = send(model_field) - if model.new_record? + if model.respond_to?(:new_record?) && model.new_record? true elsif inputs.given?(field) model.send(field) != send(field)