You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks this is where we assume there is an association named like the table. This leads to initializing a TypeCaster::Connection that is not aware of the custom attribute.
System configuration
Rails version: 8.0.1
Ruby version: 3.4.1
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 8-0-stable branch or on main, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
Steps to reproduce
Expected behavior
We should be able to list the posts linked to the comment author.
Actual behavior
ActiveRecord generates the following SQL:
we would expect:
(
74657374
is the ASCII encoded binary representation of "test")It works correctly for the
has_many
association (author -> comments).Declaring the
comments
association inPost
fixes the issue.I'm far from being familiar with ActiveRecord but while debugging, this line of code in
table_metadata.rb
felt sketchy:It looks this is where we assume there is an association named like the table. This leads to initializing a
TypeCaster::Connection
that is not aware of the custom attribute.System configuration
Rails version: 8.0.1
Ruby version: 3.4.1
The text was updated successfully, but these errors were encountered: