Skip to content

Commit 7f2bb54

Browse files
committed
Re-add InvalidValue error
1 parent 5f57a53 commit 7f2bb54

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/config/locales/en.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ en:
372372
from the child side which association to go in."
373373
resolution: "Set the values from the parent, or redefine the association
374374
with only a single definition in the parent."
375+
invalid_value:
376+
message: "Value of type %{value_class} cannot be written to a field of type %{field_class}"
377+
summary: "Tried to set a value of type %{value_class} to a field of type %{field_class}"
378+
resolution: "Verify if the value to be set correspond to field definition"
375379
mixed_relations:
376380
message: "Referencing a(n) %{embedded} document from the %{root}
377381
document via a non-embedded association is not allowed since the

lib/mongoid/errors.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
require "mongoid/errors/invalid_storage_options"
3838
require "mongoid/errors/invalid_storage_parent"
3939
require "mongoid/errors/invalid_time"
40+
require "mongoid/errors/invalid_value"
4041
require "mongoid/errors/inverse_not_found"
4142
require "mongoid/errors/mixed_relations"
4243
require "mongoid/errors/mixed_client_configuration"

0 commit comments

Comments
 (0)