This PR proposes to add belongs_to class errors to the inferred foreign key method.
This is useful when you need to display errors with rails collection select.
Examples
# app/models/post.rb
class Post < ApplicationRecord
belongs_to :user
end
# post = Post.create
# post.errors.messages # { user: ["Must must exist"] }
This PR proposes to add
belongs_to
class errors to the inferred foreign key method. This is useful when you need to display errors with rails collection select.Examples
Modified error object with proposed changes