- multiple values per subclass
- default to first value when using hash syntax
- open-closed principle
- Bug: multiple values: Child.all query (double-check)
- can we use
type
column? => yes - Factory Bot: create :property, kind: 3 => should instantiate a child OptionProperty… => Works if constant OptionProperty is loaded
- use
type
column with enum, int, string, etc. -
self.abstract_class = true
➔ This results in separate tables - What if value is not a “discriminable” value and class cannot be found?
- rubocop-minitest
- more tests / examples. [alias, non-alias] ⨉ [integer, string, boolean] ⨉ [enum, non-enum] ⨉ [type-column, non-type-column] ⨉ [multiple-values, single-values] ⨉ [subclasses, subsubclasses] ⨉ [hash-syntax, ocp-syntax]
- Documentation
- test permitted attributes
- scoping… should work OOTB
- At least document
.descendants
issue in Rails development: https://stackoverflow.com/questions/29662518/loading-class-descendants-in-rails-development - Rails 5 support (see rails-5 branch)