set_as_primary icon indicating copy to clipboard operation
set_as_primary copied to clipboard

Fix usage with an STI model

Open nbarthel opened this issue 1 year ago • 2 comments

Use the base_class to allow usage with STI

nbarthel avatar Oct 21 '24 21:10 nbarthel

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

mechanicles avatar Jan 03 '25 10:01 mechanicles

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.

nbarthel avatar Jan 23 '25 22:01 nbarthel