clio / polymorphic_integer_type

MIT License
37 stars 35 forks source link

Add fallbacks in case our type mappings don't adhere to what #polymorphic_name gives us #33

Closed Drew-Goddyn closed 3 years ago

Drew-Goddyn commented 3 years ago

Now that rails includes a #polymorphic_name method which returns the class name including namespaces, we need to add some fallbacks in case we didn't include namespaces in our original type_mappings.

If they don't we can fall back to other methods like #sti_name, base_class#to_s, or base_class#sti_name until we get a hit