-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Localized fields should be validated separately for each localization because the value should be unique in each locale.
For example, we have a document with localized attribute:
{ description:
{ "en" => "Car", "de" => "Auto" }}
We want to add a new document:
{ description:
{ "en" => "Motorbike", "de" => "Auto" }}
The description hash is different but we have the same value for "de" locale. To solve this issue I implemented uniqueness validation for licalized fields using $or selection:
validatable.or(
,
{ "description.de" => "Auto" })
case_sensitive flag was also fixed.