Exclude MissingTranslation options that are not used by the instance#581
Conversation
|
Thanks for this PR @sundling. Could you please add a description to show what drove this change? |
|
This PR recently introduced an issue for us in a scenario where we were catching I think from a convention POV, it makes sense to pass the options back via the exception. The bug that we are trying to fix in this PR is pretty specific to Rails/ActiveRecord but the change was made globally which is unexpected. Can we revert and apply a more narrow fix in ActionRecord? |
|
@simonlevasseur Yes, I think that would be a sensible approach here. |
|
Just to clarify, do you want me to revert this PR or do you plan on doing it? |
|
@simonlevasseur could you please look into it? |
|
I think we may be running into issues with this as well. Since 1.9.0 we are getting |
|
@xtreme-shane-lattanzio please open a new issue here with a link to a repo that reproduces this issue |
|
I think something was weird with including an of safe_yaml gem. We removed it and the error went away since we should be using YAML.safe_load instead of SafeYAML.load anyway |
Fixes #580
Instances of MissingTranslation are currently initialized with the options originally passed to
I18n.translate.When using ActiveRecord those options will include a reference to the instance.
And when combined with a (Rails) cache store, that MissingTranslation instance is now expected to work with Marshal.dump.
The only MissingTranslation option being used appears to be
:scope; when converting the instance to a string, so that key is kept.