#8357 Specifying association class via :class instead of :class_name


I have a ton of models where class_name is specified in associations and have been thinking for a while about doing something about it other than just using class_name: TheClassName which saves a few quote chars, but it still has to be changed to string and re-constantized if do it with class_name, so why not save 5 more chars and just use :class. At least, that was the thought.

Don’t do that. The class has to load at the point where you reference your constant; If you did that, when you’re partway through loading one class, Ruby has to go off and load the other class. That’s not a good thing.