-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private method `read_attribute_for_serialization' called for #<Model #2457
Comments
I have a patch but I can't reproduce it in the tests :( diff --git a/lib/active_model/serializer.rb b/lib/active_model/serializer.rb
index 5e347790..504b92be 100644
--- a/lib/active_model/serializer.rb
+++ b/lib/active_model/serializer.rb
@@ -395,7 +395,7 @@ module ActiveModel
if respond_to?(attr)
send(attr)
else
- object.read_attribute_for_serialization(attr)
+ object.send(:read_attribute_for_serialization, attr)
end
end |
I verified it in my app and the patch fixes the issue |
+1 |
Is this something which changed in Rails? Or is the model not valid per linter? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
expected: no errors when serializing
actual: error when serializing
active_model_serializers (0.10.14)
ruby 3.2.2 (2023-03-30 revision e51014f9c0) +YJIT [arm64-darwin22]
Darwin computer.dorianmarie.fr 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
Rails 7.1.2
The text was updated successfully, but these errors were encountered: