From a3d8a562016ba23788f0d10f6f762b8ec6dfde84 Mon Sep 17 00:00:00 2001 From: Matthew Hinea Date: Thu, 30 Oct 2025 17:34:31 -0700 Subject: [PATCH] borrow from ActiveModel --- lib/superstore/attribute_assignment.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/superstore/attribute_assignment.rb b/lib/superstore/attribute_assignment.rb index 9150d057..5ee46a10 100644 --- a/lib/superstore/attribute_assignment.rb +++ b/lib/superstore/attribute_assignment.rb @@ -1,7 +1,12 @@ module Superstore module AttributeAssignment def _assign_attribute(k, v) - public_send("#{k}=", v) if respond_to?("#{k}=") + setter = :"#{k}=" + public_send(setter, v) + rescue NoMethodError + if respond_to?(setter) + raise + end end end end