class Report
include Mongoid::Document
embeds_many :figures
end
class Figure
include Mongoid::Document
embedded_in :report
field :legend
validates_presence_of :legend
end
Yields this error message:
Figures is invalid
How can I get the plurality in the error message to agree?
The translation from errors into readable messages is handled by ActiveModel rather than Mongoid, and embedded models are considered to just be attributes in terms of attribute localization.
In this case, if you use the below in an i18n file you’ll get a singular form rather than plural by modifying what
human_attribute_namereturns for the figures attribute: