Values are not autoloaded when model's field was not started
It's not able the following without any instance being created before it:
User.roles
That happens because the enum methods are only created after the schema of the model is loaded. That said, whevener ActiveRecord::Base
is extended and the enum.initializer
is set to true, I can either load the schema of the model, or (that has more performance) only identifies those class-related methods that should be defined.