Skip to content

Conversation

@nbarthel
Copy link

Use the base_class to allow usage with STI

@mechanicles
Copy link
Owner

@nbarthel Sorry, I missed your PR. Could you please elaborate your problem with an example?

@nbarthel
Copy link
Author

nbarthel commented Jan 23, 2025

Missed your response. I am using on an STI table which resulted in issues in STI models. My solution was to return base_class rather than https://api.rubyonrails.org/classes/ActiveRecord/Inheritance/ClassMethods.html#attribute-i-base_class. My specific use-case was to inherit primary from the base_class. This may or may not be appropriate in all cases. e.g. defaults per type.

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