Skip to content

Fix compatibility with Rails delegated_type#3

Merged
nerlichman merged 2 commits intomainfrom
fix/compatibilty-with-delegated-types
Mar 14, 2026
Merged

Fix compatibility with Rails delegated_type#3
nerlichman merged 2 commits intomainfrom
fix/compatibilty-with-delegated-types

Conversation

@santipais
Copy link
Copy Markdown
Contributor

belongs_to accepts an optional scope as the second argument. safe_polymorphic was not forwarding this argument correctly, causing an ArgumentError when used with APIs like delegated_type.

belongs_to accepts an optional scope as the second argument.
safe_polymorphic was not forwarding this argument correctly,
causing an ArgumentError when used with APIs like delegated_type.
Copy link
Copy Markdown
Contributor

@nerlichman nerlichman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding 3 new models, could we create just one new model that defines delegated_type to some of the other existing models?

Doesn't seem necessary to actually create House and Office.

@nerlichman nerlichman merged commit 9822694 into main Mar 14, 2026
4 checks passed
@nerlichman nerlichman deleted the fix/compatibilty-with-delegated-types branch March 14, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants