set_as_primary
set_as_primary copied to clipboard
Fix usage with an STI model
Use the base_class to allow usage with STI
@nbarthel Sorry, I missed your PR. Could you please elaborate your problem with an example?
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.