Context
Since 0.2.0, it has become possible to set Mobility.default_options which are merged into the options set whenever translates is called on a Mobility model. However, the problem with this is that the "default" default_options is overridden if the user sets these options with Mobility.default_options =, which will typically disable "low-profile" plugins like presence and cache.
Expected Behavior
Setting Mobility.default_options = raises an error and instructs the user to set options by their key, e.g.:
Mobility.configure do |config|
# ...
config.default_options[:fallbacks] = { ... }
config.default_options[:dirty] = true
# ...
end
Actual Behavior
Mobility allows default options to be overridden entirely, implicitly disabling any options which were previously true but now are nil.
Possible Fix
Add a deprecation warning on the setter in 0.3.0, and remove thereafter.
Context
Since 0.2.0, it has become possible to set
Mobility.default_optionswhich are merged into the options set whenevertranslatesis called on a Mobility model. However, the problem with this is that the "default" default_options is overridden if the user sets these options withMobility.default_options =, which will typically disable "low-profile" plugins like presence and cache.Expected Behavior
Setting
Mobility.default_options =raises an error and instructs the user to set options by their key, e.g.:Actual Behavior
Mobility allows default options to be overridden entirely, implicitly disabling any options which were previously
truebut now arenil.Possible Fix
Add a deprecation warning on the setter in 0.3.0, and remove thereafter.