This project is archived and is in readonly mode.
It's hard to understand errors generated by ActiveRecord::Base compute_type method
-
Ivan Konyshev
After all it was mistake in my RatingCriteria definition.. Error message is completely misunderstandable.
ArgumentError was swallowed and uninitialized constant error generated with name of first candidate. -
Ivan Konyshev
- Title changed from Error in ActiveRecord::Base compute_type method to It's hard to understand errors generated by ActiveRecord::Base compute_type method
-
Andrew White
- State changed from new to invalid
- Importance changed from to Low
The error message is the same as you would get with pure ruby:
#!/usr/bin/ruby class Category def build RatingCriteria.new end end Category.new.build >> uninitialized constant Category::RatingCriteria (NameError)The rescue for ArgumentError is there because constantize can raise one in certain circumstances but the correct class will eventually be found. The error message can't specifically refer to setting :class_name for an association as it's used elsewhere as well (e.g. STI).