Skip to content

Conversation

@fusion2004
Copy link
Contributor

@fusion2004 fusion2004 commented Dec 19, 2024

If you are using polymorphic association fields, you can now customize how Subroutine
resolves those class names to a ruby class by setting a global callable/lambda/proc:

::Subroutine.constantize_polymorphic_class_name = ->(class_name) do
  class_name.classify.constantize
end

@fusion2004 fusion2004 force-pushed the configurable-polymorphic-class-resolution branch from b9fa3f9 to 643489b Compare December 19, 2024 02:18
@fusion2004 fusion2004 force-pushed the configurable-polymorphic-class-resolution branch from bfce84e to 860090b Compare December 19, 2024 02:34
@mnelson mnelson merged commit 6240136 into main Dec 19, 2024
4 checks passed
@mnelson mnelson deleted the configurable-polymorphic-class-resolution branch December 19, 2024 02:52
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.

3 participants