我正在使用 Mobility gem (v0.4.3 - https://github.com/shioyama/mobility ) 和 Rails 5.2,目前要设置后备,我必须在模型中进行设置:
class Client < ApplicationRecord
....
extend Mobility
translates :title, type: :string, locale_accessors: true, fallbacks: { en: :es }
....
end
主要问题是后备哈希是静态的,在我的应用程序中,哈希可能会根据客户端配置而改变。
有什么方法可以动态设置后备哈希?