The Rails ActionView inputs get the value of a field from the _before_type_cast method if it exists.
In Mongoid 7, the Mongoid core team implemented the _before_type_cast? / _before_type_cast for ALL the fields including the localized ones.
Incidentally, it breaks the form inputs for localized fields.
This patch restores the old behavior for localized fiels by implementing the X_came_from_user? method which makes the form inputs use the translated value of a field.
Explanation:
The Rails ActionView inputs get the value of a field from the_before_type_cast method if it exists.
In Mongoid 7, the Mongoid core team implemented the
_before_type_cast?
/_before_type_cast
for ALL the fields including the localized ones.Incidentally, it breaks the form inputs for localized fields.
This patch restores the old behavior for localized fiels by implementing the X_came_from_user? method which makes the form inputs use the translated value of a field.