You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents converting a `NameError` from incidental code into a
"friendly" `NameError` for the association model class. For example, in
a scenario like:
```ruby
# app/models/post.rb
class Post < ActiveRecord::Base
belongs_to :author
end
```
```ruby
# app/models/author.rb
class Author < ActiveRecord::Base
validates_presence :name
end
```
This changes the error message from:
> Missing model class Author for the Post#author association. You can
> specify a different model class with the :class_name option.
to:
> undefined method 'validates_presence' for Author:Class
>
> Did you mean? validates_presence_of
Fixesrails#46532.
0 commit comments